I'm using a code from the android documentation itself to create the timepicker as a dialog, but it's popping up like this
AndIwantittoappearlikethis
Classthatcreatestimepicker
publicclassTimePickerFragmentextendsDialogFragmentimplementsTimePickerDialog.OnTimeSetListener{@OverridepublicDialogonCreateDialog(BundlesavedInstanceState){//UsethecurrenttimeasthedefaultvaluesforthepickerfinalCalendarc=Calendar.getInstance();inthour=c.get(Calendar.HOUR_OF_DAY);intminute=c.get(Calendar.MINUTE);//CreateanewinstanceofTimePickerDialogandreturnitreturnnewTimePickerDialog(getActivity(),this,hour,minute,DateFormat.is24HourFormat(getActivity()));}publicvoidonTimeSet(TimePickerview,inthourOfDay,intminute){//Dosomethingwiththetimechosenbytheuser}}
CODEINVALIDINGTHETIMEPICKERTHROUGHTHEBUTTONCLICK
publicvoidshowTimePickerDialog(Viewv){DialogFragmentnewFragment=newTimePickerFragment();newFragment.show(getSupportFragmentManager(),"timePicker");
}