Questions tagged [android-datepicker]

Android DatePicker is a widget for selecting a date. The date can be selected by a year, month, and day spinners or a CalendarView. The set of spinners and the calendar view are automatically synchronized.

Android DatePicker is a widget for selecting a date. The date can be selected by a year, month, and day spinners or a CalendarView. The set of spinners and the calendar view are automatically synchronized.

Android DatePickerDialog is a dialog that hosts a DatePicker widget.

786 questions
0
votes
2 answers

Getting string from date picker dialog fragment

I am using the example from the documentation. From the method public void onDateSet(DatePicker view, int year, int month, int day) { // Do something with the date chosen by the user } I want the string "Mon, Sep 14, 2014". How do I get it?…
Cote Mounyo
  • 13,817
  • 23
  • 66
  • 87
0
votes
3 answers

DatePickerDialog always opens the current date

I am having trouble with a DatePickerDialog, everytime I open it shows the current date not the date I set previously. Here's my code: final Calendar c = Calendar.getInstance(); final int mYear = c.get(Calendar.YEAR); final int mMonth =…
0
votes
2 answers

android - how can I know which editText was clicked in dialog fragment class

I have two editText views, and when a user clicks the first editText, a dialogfragment window opens and the user selects the date. The same happens with the second editText. The date selected should be "written" in the editText.This works like a…
0
votes
3 answers

Change the dateformat in Android

I am using calender in my app and i want to change the format of the date. private void updateLabel() { String myFormat = "dd/MM/yy"; // In which you need put here SimpleDateFormat sdf = new SimpleDateFormat(myFormat, Locale.US); …
Pooja Dubey
  • 683
  • 2
  • 14
  • 34
0
votes
1 answer

change title when user select date

I want to change title(User selected date to be shown) when user making change in the Date picker.any idea i am using this code.ondatechange not working hear public void showDatePicker(){ LayoutInflater inflat=(LayoutInflater)…
parmitKR
  • 47
  • 13
0
votes
2 answers

How to get saved date in date picker view in android?

I am trying to create a task management app, and I need to set a due date on every task that will be created. I am able to save selected date in database but when I am updating it, I am facing issue. I am trying to get same date in datepicker view,…
Shweta
  • 1,145
  • 5
  • 18
  • 35
0
votes
1 answer

Changing the layout of DatePicker

Is there any way to reformat the datePicker so that instead of getting "mm/dd/yyyy" you can get "dd/mm/yyyy" or even "dd/mm/yy" This is my current code. import android.app.Activity; import android.app.DatePickerDialog; import…
Mark O'Sullivan
  • 10,138
  • 6
  • 39
  • 60
0
votes
1 answer

How to show dialog from Expandble list adapter which is in an Activity Group

I am using an Activity Group which contain an Activity which is using a BaseExpandableListAdapter . It has 2 method groupview and child view. In child view i want to use dialog boxes ( showDialog(DATE_PICKER) ) but code doesn't reach the…
0
votes
2 answers

How to handle dynamically created datepickers?

I am trying to create date pickers dynamically (where I do not know the exact number). I was referring to this tutorial http://javapapers.com/android/android-datepicker/. In my code I create date pickers in the following way :- TableRow row = new…
0
votes
1 answer

How can I pass or get the result to my MainActivity?

I want to create date and timepicker in my current android project. I have other code in my MainActivity. This is a new class "Changedatetime" I added that contains my time and datepicker code. Now how can I pass or get the result of the pickers to…
Et Andrea
  • 273
  • 4
  • 21
0
votes
2 answers

Calling Android DatePicker constructor when adding a DatePicker widget dynamically to the layout throws exception

I'm developing an Android application that generates the layout widgets in the UI dynamically at runtime (this is because the amount and the types of widgets are undefined) public class DynamicLayout extends Activity{ private ScrollView…
Hamdi Baccara
  • 29
  • 1
  • 11
0
votes
2 answers

Querying Sqlite database in android

Thish code work fine for me it show the information of every employee one by one. BUT i want to see only the information of the one employee of given id. how can i do that . c=myDbHelper.query("EMP_TABLE", null, null, null, null,null, null); …
0
votes
1 answer

How to take data from the database

I have to make a database of question and their answer.I made it using sqlitedatabase browser and put in Assets folder. This is my code to retrieve the row of a particular question id. Some important information My database name is extenalDB. my…
0
votes
1 answer

error in time picker and date picker

I have written this code. It does not give error but gives wrong output. The date is displayed in times place and time in its place. I also have to set alarm. I am doing a to do app Please help me to get my code correct and also set alarm.. My…
jan srkl
  • 55
  • 1
  • 9
0
votes
3 answers

Difference between dates

I am using datepicker to allow the user to pick his date of birth and onDateSet() method i am calculating his age. I have read lot of people recommending this but it is giving wrong answer. Here is my code class DOBDatePicker extends DialogFragment…
Ravi
  • 4,872
  • 8
  • 35
  • 46