How to fix MainActivity cannot be cast to android.app.TimePickerDialog$OnTimeSetListener in a fragment?
问题 i'm doing my school project in android since days ago, and I got a problem today. I did a menu with fragments and I need to put a TimePickerDialog inside a fragment and for me it's impossible, everytime when I press the button lo launch the Dialog the app crashes. I try to put implements in the class of the TimePickerFragment but it doens't work, I need to bring the things in my main fragment, not in the Dialog. Here is my main fragment, called "DespertarFragment": @Override public View