If I am using parent layout as container.. fragment is not visible
and if i use child layout as container.. its displaying fragment in wrap_content, not in full screen.. even my fragment layout height is match_parent
How to open fragment in full screen?
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:id="@+id/container"> <!-- this id identifies fragment container -->
<LinearLayout
style="@style/innerContainer"
android:layout_margin="6dp"
android:background="@drawable/container">
</LinearLayout>
</LinearLayout>
fragment layout
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context="com.example.thevisionspark.jobsite.AppliedUsers">
<LinearLayout
style="@style/innerContainer">
<TextView
style="@style/headings"
android:text="Applied Users"
android:layout_gravity="center_horizontal"/>
</LinearLayout>
</LinearLayout>
fragment loading code
FragmentTransaction fm = getSupportFragmentManager().beginTransaction();
AppliedUsers frag = new AppliedUsers();
frag.setArguments(bundle);
if(getSupportFragmentManager().getFragments() == null)
fm.add(R.id.container, frag).commit();
else fm.replace(R.id.container, frag).commit();