I am a new android dev. I want to use a same TextView in all activity. But, i don't know how to declare TextView as global Variable & How can i use this to show text in activity. Please help me. The code is simple. Thank for every one.
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How can I create this custom Bottom Navigation on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
I think this Link this is helpfull to
http://alinberce.wordpress.com/2012/02/20/android-edittext-with-custom-font-and-clear-button/
you have to create
Editbox
just One time & use anywhere in Applicationweather use in
Layout
file or use Dynamically in javaClass
Write your XML code of text view with id as:
Than in your activity declare it before onCreate() method as:
Than this will be accessible to all calsses.
You can use this everywhere:
Make it a singleton. Or just keep one public static reference.
and then you can use it anywhere by calling
MyReference.myTextView