我如何可以声明的TextView作为全局变量在其他类中使用 [英] How can I declare TextView as global variable to use in other class
本文介绍了我如何可以声明的TextView作为全局变量在其他类中使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我是一个新的Android开发人员。我想用一个相同的的TextView 中的所有活动。但是,我不知道如何声明的TextView作为全局变量和放大器;我该如何使用它来显示活动文本。请帮我。 的code是简单的。 感谢为每一位。
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.
推荐答案
您可以使用此无处不在:
You can use this everywhere:
TextView textview = (TextView) findViewByID(Your ID);
textview = (TextView) findViewByID(Your ID);
这篇关于我如何可以声明的TextView作为全局变量在其他类中使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文