Reputation: 1454
I'm getting a really strange error with a TimePickerFragment object I've created in my Android app and was hoping someone could help me out a bit. The code where the object is created is as follows:
public void showTimePickerFragment(View v){
TimePickerFragment newFrag = new TimePickerFragment();
newFrag.show(getFragmentManager(), "timePicker");
}
For some reason I'm getting an error on .show(). The error message I have is:
The method show(FragmentManager, String) in the type DialogFragment is not applicable for the arguments (FragmentManager, String)
I'm not sure if I'm just overlooking something here but that's a really confusing error message to me. I've tried changing "getFragmentManager()" to "getSupportFragmentManager()" but that causes an error with the arguments!
I've also already imported all the classes I need for this app, so it isn't a problem with that.
If anyone needs to see more code I can totally post it here. Any help would be greatly appreciated!!!
Thanks all!
Upvotes: 0
Views: 297
Reputation: 87064
The error comes from not using the right imports for the classes(so the method expects a different type then the one you provide). Make sure you either use use only the classes from the compatibility package or the normal ones from the android SDK.
Upvotes: 1