In my application i have edit text that will show the current date and time initially . If i change the date to some other date and when i tried to use gettext() i am still getting the current date. can anyone help. This is my code to set initial value in edit text
TaskTime = (EditText) findViewById(R.id.txtTaskTime);
Date date = new Date();
java.text.DateFormat dateFormat = android.text.format.DateFormat.getDateFormat(getApplicationContext());
TaskDate.setText(dateFormat.format(date));
Yes, you can get the current date because ,
Date date = new Date();this function always returns the current date .So you need to use the
Calendarobject to get the current date and time .Example
Here in dateFormat you have to declare your date format .
dateFormat = "dd/MM/yyyy"like .