I have a fragment. In my On create I do set my inflater as follows.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
v= inflater.inflate(R.layout.dashboard_two, container, false);
getActivity().getActionBar().setTitle("NV Technologies");
new HttpRequestFaultList().execute();
return v;
}
I want to change the inflater ti display A different Layout outside of onCreate view. I have tried:
v= inflater.inflate(R.layout.custom_dash, container, false);
custom_dash.xml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:id="@+id/testFrag"
android:layout_height="match_parent"
android:orientation="vertical" >
<ImageView
android:id="@+id/imageView1"
android:layout_width="269dp"
android:layout_height="387dp"
android:layout_gravity="center"
android:scaleType="centerInside"
android:src="@drawable/message" />
</LinearLayout>
But because it is outside of the onCreate there does not exist an inflater or a container. I want to change the Layout in a catch block and if there is a catch the Layout must change. Is it even possible to change the layout in the Fragment but outside of the onCreate method? And how