android-timepicker

Simple timepicker for a fragment activity

蓝咒 提交于 2019-11-28 10:53:44
问题 I am trying to launch a timepicker from a edittext in a fragment Buffet_offerings_breakfast_menu2.java public class Buffet_offerings_breakfast_menu2 extends Fragment implements PickTime{ RadioGroup radioGroup; EditText ed1,ed2; boolean flag =false; TimePickerFragment newFragment; @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // TODO Auto-generated method stub final View view=inflater.inflate(R.layout.buffet_offerings_breakfast

How do I set AM/PM in a TimePicker?

做~自己de王妃 提交于 2019-11-28 02:29:39
问题 I am using a TimePicker in my app. Whenever the user opens the screen with the TimePicker, I initialize it with the current time. When I do this, the TimePicker shows AM instead of PM. Why does this happen? Is there anything I have to add in my code? Date initDate = m_NoteManageObject.getDateTimeArray(position); Calendar myCal = Calendar.getInstance(); myCal.setTime(initDate); TimePicker timePicker = (TimePicker)layout.findViewById(R.id.time_picker); // Initialise Time Picker timePicker

How to change the style of a DatePicker in android?

对着背影说爱祢 提交于 2019-11-27 10:57:22
I want to change the default color of the date/time picker dialog in Android, so that it should match my app's theme. I searched for the solution on Google, but I couldn't find a solution. What I was doing was creating a new style: <style name="datepicker" parent="@android:style/Widget.DeviceDefault.DatePicker"> <!---TODO--> <item name="android:focusedMonthDateColor">@android:color/holo_red_dark</item> </style> Don't know what are the attributes available for date picker dialogue. It would be great if anyone could post a link on that and after adding the style I was calling it in my main style

TimePicker Dialog from clicking EditText

你说的曾经没有我的故事 提交于 2019-11-27 10:46:20
I've already got a DatePicker which pops up when the user clicks on the EditText field eReminderDate.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub //To show current date in the datepicker Calendar mcurrentDate = Calendar.getInstance(); int mYear = mcurrentDate.get(Calendar.YEAR); int mMonth = mcurrentDate.get(Calendar.MONTH); int mDay = mcurrentDate.get(Calendar.DAY_OF_MONTH); DatePickerDialog mDatePicker; mDatePicker = new DatePickerDialog(AddReminder.this, new OnDateSetListener() { public void onDateSet(DatePicker

Android API 21 - TimePicker widget

╄→гoц情女王★ 提交于 2019-11-27 03:13:19
问题 I've got a problem with the TimePicker widget on API 21. Until API 19 the TimePicker was an up-/down-list like iOS, but in 21+ it's round, like the one in the calendar app. How can I use the old one in 21+, because it breaks my design, if it is the new widget. 回答1: You can specify the spinner-style time picker by setting the timePickerMode attribute to "spinner". The default value on Material is "clock". <TimePicker ... android:timePickerMode="spinner" /> 回答2: You can Programatically use the

Android: Setting time in time picker with the time shown in text view

假装没事ソ 提交于 2019-11-26 20:56:09
问题 In my app, I am showing time in text view as 07:00 PM. On click of the text view, a time picker dialog pops up, In that time picker, I have to show exactly the same time as what is appearing in textview. But, I am not getting how to do that. CODE SimpleDateFormat sdf = new SimpleDateFormat("HH:mm a"); //int hr = 0; Date date = null; try { date = sdf.parse(resDateArray[3]); } catch (ParseException e) { e.printStackTrace(); } final Calendar calendar = Calendar.getInstance(); calendar.setTime

Is it possible to change the style of an Android L TimePickerDialog?

帅比萌擦擦* 提交于 2019-11-26 20:25:07
问题 I was testing my app on an Android L emulator, and I noticed that the TimePickerDialog has significantly changed to this: This doesn't fit with the theme of my app, and I wanted to know if it is possible to get the old TimePickerDialog style when running on Android L. 回答1: You can use the TimePickerDialog constructor with theme parameter to specify the theme. TimePickerDialog(Context context, int theme, TimePickerDialog.OnTimeSetListener callBack, int hourOfDay, int minute, boolean

How to change the style of a DatePicker in android?

别说谁变了你拦得住时间么 提交于 2019-11-26 17:58:00
问题 I want to change the default color of the date/time picker dialog in Android, so that it should match my app's theme. I searched for the solution on Google, but I couldn't find a solution. What I was doing was creating a new style: <style name="datepicker" parent="@android:style/Widget.DeviceDefault.DatePicker"> <!---TODO--> <item name="android:focusedMonthDateColor">@android:color/holo_red_dark</item> </style> Don't know what are the attributes available for date picker dialogue. It would be

Show TimePicker with minutes intervals in android

穿精又带淫゛_ 提交于 2019-11-26 17:11:10
My application show a TimePickerDialog to set a time. I want that the timePickerDialog show the minutes with an interval of 5 minutes. This works fine with this code: private final int TIME_PICKER_INTERVAL=5; private boolean mIgnoreEvent=false; … public TimePickerDialogs(Context arg0, OnTimeSetListener callBack, int hourOfDay, int minute, boolean is24HourView) { super(arg0, callBack, hourOfDay, minute, is24HourView); formato=Statics.formato; } @Override public void onTimeChanged(TimePicker view, int hourOfDay, int minute) { //super.onTimeChanged(arg0, arg1, arg2); if (mIgnoreEvent) return; if

TimePicker Dialog from clicking EditText

╄→尐↘猪︶ㄣ 提交于 2019-11-26 15:19:14
问题 I've already got a DatePicker which pops up when the user clicks on the EditText field eReminderDate.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub //To show current date in the datepicker Calendar mcurrentDate = Calendar.getInstance(); int mYear = mcurrentDate.get(Calendar.YEAR); int mMonth = mcurrentDate.get(Calendar.MONTH); int mDay = mcurrentDate.get(Calendar.DAY_OF_MONTH); DatePickerDialog mDatePicker; mDatePicker =