I have some activities displaying the current date and time. I want to make only one text view (layout) txtTime showing time and it will be updated each second by a handler in main activity. Then others views of other activities can re-use the text view txtTime by including. (I want only 1 handler updating date/time value and all app activities can display this value)
In fact, I don't know how to create/access a text view like that txtTime. As usual I find a text view by (Activity).findViewById(R.id...). But since it does not belongs to any activity I got stuck there.
My pb: How to use a TextView as an application circle object which doesn't belongs to any activity? How to change its text value(Date or Time)?
Do you have any suggestion/solution for me? Thanks,
@ The reponse of Remy: You want something like that : static final TextView appTimeText = new TextView(appContext);, And in the handler appTimeText.setText("Text"); Now when you create the latout in any activity simple add it. – Remy