i am developing an android app where in i am displaying the date and time for the user on the main screen of my app. I am using the below code for it.
SimpleDateFormat sdf = new SimpleDateFormat("EE, dd MMM yyyy");
String strtDates = sdf.format(cal.getTime());
textviewfordate.setText(strtDates);
clk = (DigitalClock)findViewById(R.id.digitalClock);
However, when the time is changed, the date doesnot get updated without refreshing the screen. For example when the time is 11:59:00 PM and when the time changes to 12:00:00 AM, the date will not be updated. It gets updated only when the screen is refreshed. I want the date to be changed automatically without refreshing the screen.
Not getting how to do it! Please Help! Thanks!