how to simply store selected time From TimePicker in android that value i am geeting in edittext? -
I want to get the time of Android from time-picker and I would like to store the appropriate variables that would be appropriate for it . How can I get the time that is chosen by the user in an easy way?
I've been getting me the value of time-picker on editing text, but how can I get him in a proper variable.
This is my Javood: -
et = (editable text) Khojwubiaiaidi (RID Kmar); et.setOnClickListener (New OnClickListener () {@Override public void onClick (View v) {// TODO Auto-generated method stub calendar mcurrentTime = Calendar.getInstance (); int h = mcurrentTime.get (Calendar.HOUR_OF_DAY); int min = McURrentTime.get (calendar.MINUEE); Time PictureDyLog mTimePicker; mTimePicker = New TimePicardialism (Timepicker. This, New Time PictureDialog.OnTimeTestistizer) {@Override Public Zero Perimetset (Timepick timer, selected, green, selected selected) {et .setText (selectedHour + ":" + selecte DMinute);}}, hour, minute, wrong); // Yes 24 hours time mTimePicker.setTitle ("select start time"); MTimePicker.show ();}}); (using instead et.setText) current time to revisit And just modify the properties of hours and minutes to the newly selected ones.
Calendar Start Time = Calendar. Just Instance (); Int hour = initialTime.get (calendar.HOUR_OF_DAY); Int minute = initialTime.get (calendar.MINUEE); Time Piccrdaylog mTimePicker = new Taimpikardaylog (Timipikarkis time, new time Piccrdaylog Kontaimstetistaijhr) {@Override public Taimset zero (Taimkictor time picker, e selected, green, e selected selected) {calendar Chalutaim = Kailenderkjast Instens () ; Current time.set (calendar. selectedHour); CurrentTime.set (Calendar.MINUTE, selectedMinute); Date selectedDate = currentTime.getTime ();}}, hour, minute, wrong); // Yes 24 hours time mTimePicker.setTitle ("select start time"); MTimePicker.show (); Hopes
Comments
Post a Comment