java - Overriding time from settings page -


i want override time settings page app screen. attaching 2 pictures 1 app screen time need override , second 1 settings pagethis 1st picture i.e; app screen time need override here.. if want change 5:00 pm how can it?this second image settings page when input time here time need change in first image

so here think trying achieve,

1.have 1 page in app (i.e. first image) show current time.
2.you want page change according time set on phone.

use following code system time

calendar c = calendar.getinstance(); simpledateformat df = new simpledateformat("hh:mm a"); string formattedtime = df.format(c.gettime()); // formatteddate have current date/time textview.settext(formattedtime); //set time view 

using above code can have view set time system time. ps make sure set time in onresume() method of activity well


Comments

Popular posts from this blog

c# - Class in a list -

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -