Android - Re-use TextView showing current date time in multiple activities -


i have activities displaying current date , time. want make 1 text view (layout) txttime showing time , updated each second handler in main activity. others views of other activities can re-use text view txttime including. (i want 1 handler updating date/time value , app activities can display value)

in fact, don't know how create/access text view txttime. usual find text view (activity).findviewbyid(r.id...). since not belongs activity got stuck there.

my pb: how use textview application circle object doesn't belongs activity? how change text value(date or time)?

do have suggestion/solution me? thanks,

@ reponse of remy: want : static final textview apptimetext = new textview(appcontext);, , in handler apptimetext.settext("text"); when create latout in activity simple add it. – remy

tell me if understand currectly, dont want make textview inside activity, because want use in life circle of application? if im understand currect want application context. can retrievegetresources()

im hope im understand properly.


Comments

Popular posts from this blog

PHP DOM loadHTML() method unusual warning -

python - How to create jsonb index using GIN on SQLAlchemy? -

c# - TransactionScope not rolling back although no complete() is called -