How can I declare TextView as global variable to use in other class

前端 未结 4 1915
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-16 05:45

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 thi

4条回答
  •  温柔的废话
    2021-01-16 06:01

    You can use this everywhere:

    TextView textview = (TextView) findViewByID(Your ID);
     textview = (TextView) findViewByID(Your ID);
    

提交回复
热议问题