-2

Please anybody help me to remove the texview from android timepicker dialogue.

here is my timepicker function.

public void showTimePickerDialog(View v) {
    timeFragment = new TimePickerFragment();
    timeFragment.show(getFragmentManager(), "timePicker");
}
@SuppressLint("ValidFragment")

 public class TimePickerFragment extends DialogFragment
        implements TimePickerDialog.OnTimeSetListener {

    @Override
    public Dialog onCreateDialog(Bundle savedInstanceState) {
        // Use the current time as the default values for the picker
        final Calendar c = Calendar.getInstance();
        int hour = c.get(Calendar.HOUR_OF_DAY);
        int minute = c.get(Calendar.MINUTE);

        // Create a new instance of TimePickerDialog and return it
        return new TimePickerDialog(getActivity(), this, hour, minute,
                DateFormat.is24HourFormat(getActivity()));
    }

    public void onTimeSet(TimePicker view, int hourOfDay, int minute) {
        // Do something with the time chosen by the user
        timeCal.set(Calendar.HOUR_OF_DAY, hourOfDay);
        timeCal.set(Calendar.MINUTE, minute);
        updateTimeText();
    }
}

This is the code i used for timepicker dialogue

Ashfaq
  • 27
  • 7

2 Answers2

1

Try like this

dialog.setTitle("");

so totally

@Override
    public Dialog onCreateDialog(Bundle savedInstanceState) {
        final Calendar c = Calendar.getInstance();
        int hour = c.get(Calendar.HOUR_OF_DAY);
        int minute = c.get(Calendar.MINUTE);
        int seconds = c.get(Calendar.SECOND);
        TimePickerDialog dialog = new TimePickerDialog(getActivity(), this, hour, minute,true);
        dialog.setTitle("");
        return dialog;
    }
Anil
  • 1,605
  • 1
  • 14
  • 24
0

Remove below lines from your code;

  picker.setCurrentHour(c.get(Calendar.HOUR_OF_DAY));
  picker.setCurrentMinute(c.get(Calendar.MINUTE));
Vishal Vaishnav
  • 3,346
  • 3
  • 26
  • 57