findViewByID返回空
android:id
id
View.findViewById
Activity.findViewById
location_layout.xml
<FrameLayout .... > <some.package.MyCustomView ... /> <LinearLayout ... > <TextView ... android:id="@+id/txtLat" /> ... </LinearLayout></FrameLayout>
...setContentView( R.layout.location_layout );
... TextView tv = (TextView) findViewById( R.id.txtLat );
null
. 这样做,我的活动运作良好。Activity.findViewById
View.findViewById
...TextView tv = (TextView) ((Activity) context).findViewById( R.id.txtLat );
null
.
ViewGroup
View
location_layout.xml
TextView
View.findViewById
慕斯王
拉丁的传说
相关分类