Hello!
I want my application to display the TimePicker dialog when the user clicks on the settings item (Preference). I already created a DialogFragment that creates a TimePicker dialog box, but I cannot associate this fragment with a user preference. How can I do that?
Here's the DialogFragment class that should be associated with user preference:
import java.util.Calendar; import android.app.Dialog; import android.app.TimePickerDialog; import android.os.Bundle; import android.app.DialogFragment; import android.text.format.DateFormat; import android.widget.TimePicker; public class MyDialogFragment extends DialogFragment implements TimePickerDialog.OnTimeSetListener { @Override public Dialog onCreateDialog(Bundle savedInstanceState) {
PS. I read the Android developer tutorial (
http://developer.android.com/guide/topics/ui/settings.html ), but this is a bit confusing to me. Thank you so much for your help!
source share