To illustrate examples of fragments and the back stack, we will extend our application further. We will create a fragment to display a user manual containing the text, Lorem ipsum. First we need to create a new fragment. Create a new layout named fragment_manual. Update the layout as shown in this example:
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android= "http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <TextView android:layout_width="match_parent" android:layout_height="match_parent" android:layout_margin="10dp" android:text="@string/lorem_ipsum_sit_dolore" android:textSize="14sp" /> </LinearLayout>
This ...