Ne pouvez pas obtenir la vue parent de fragment

J'ai besoin de mettre à jour un textview à partir d'un ListFragment qui est sur le même plan, dans le fichier XML, comme le TextView.
Mais les deux essaye juste renvoie la valeur null:

@Override
public void onCreate(Bundle ice)
{
    super.onCreate(ice);

    ...

    mAdapter = new SimpleCursorAdapter(getActivity(), R.layout.entry_row, null, from, to, 0);
    setListAdapter(mAdapter);

    mTextView = (TextView) getActivity().findViewById(R.id.tv); //try #1

    mPercentView = (TextView) ((ViewGroup)getView().getParent()).findViewById(R.id.tv); //try #2
    //(not tested at the same time)
}

C'est le XML:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
 android:layout_width="match_parent"
 android:layout_height="match_parent" >


<TextView
    android:id="@+id/info_log_view"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentRight="true"
    android:padding="@dimen/object_padding"
    android:textSize="24sp"
    android:textIsSelectable="true" />

<fragment
    android:id="@+id/view_log_fragment"
    android:name="fragment name..."
    android:layout_width="match_parent"
    android:layout_height="match_parent" 
    android:layout_below="@+id/info_log_view" />

</RelativeLayout>

Merci!

OriginalL'auteur Lonecoder13 | 2013-05-14