程序非常简单,好长时间没有搞定,郁闷。。。。。。。。。。。。在论坛咨询,终于找到答案。
描述:
一个Activity:MainActivity,内部是一个Fragment:FragmentA,FragmentA里面有TextView。
问题:无论如何也得不到FragmentA内部的TextView,返回值永远是Null
具体描述:
MainActivity的layout:activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent">
<fragment android:name="com.fragmentexercise.FragmentA"
android:id="@+id/fragment_a"
android:layout_width="match_parent"
android:layout_height="match_parent" />