我们可以使用 findviewbyid
元素不属于主要的任务,但另外一个隐藏的活动?
Can we get using findviewbyid
an element not part of the main current activity but another hidden activity ?
在为了能够 findViewById
来找到你的查看
元素它必须是当前视图层次结构的一部分。否则,你必须使用充气
。充气
In order to be able findViewById
to find your View
element it has to be part of the current view hierarchy. Otherwise you have to use an inflater
. The inflater
实例化布局的XML文件到其对应的视图对象。
Instantiates a layout XML file into its corresponding View objects.
通过您可以拨打充气返回的视图对象 findViewById
through the view object returned by the inflater you can call findViewById