Hello I have a ListFragment that fetches some data from the net and then uses a renderer to display them. The problem is that if I add a simple TextView like so:
TextView tv = new TextView(getActivity());
then it works fine, but if I try to add a more complex view then the application freezes.
I have also tried to inflate the view from an xml but no luck.
Basically I am trying to inflate this RelativeLayout:
<RelativeLayout
android:id="@+id/listView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_centerVertical="true"
android:background="@color/main_background" >
<TextView
android:id="@+id/textView1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/leave_comment"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:textColor="@color/resultlist_title"/>
<EditText
android:id="@+id/editText1"
android:layout_width="230dp"
android:layout_height="wrap_content"
android:layout_below="@+id/textView1"
android:layout_marginLeft="10dp"
android:inputType="textPostalAddress" >
</EditText>
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/leave_commentbtn"
android:background="@drawable/venue_post"
android:layout_below="@+id/textView1"
android:layout_toRightOf="@+id/editText1"
style="@style/list_button"
android:layout_marginLeft="18dp"
android:layout_centerInParent="true"
android:textColor="@color/white"/>
<ProgressBar
android:id="@+id/progressBar1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true" />
am I missing something? is it not possible to add a relative layout as footer view?
To inflate relative layout you can use:
hope it will work then you can add it where you want.