10) Scrollable tabs

Creating a scroll tab: 1) Create the fragment classes and layouts 2) Create a view pager - a view pager is layout manager where each child is a separate page.…

Continue Reading 10) Scrollable tabs

9) Dialog Fragment

A Dialog box is like a prompt for user decisions/information for an app to continue a task (e.g. deleting a record in a database) A Dialog Box is composed of…

Continue Reading 9) Dialog Fragment

8) ListFragment

In this example the fragment xml file is hard coded into the activity_main.xml file. We could however use the fragment manager and add() method in the java code to give…

Continue Reading 8) ListFragment

4) Getting fragments to talk to each other

Example below is from Vivz slide nerd videos on youtube MainActivity.java FragmentA.java FragmentB.java activity_main.xml fragment_a.xml fragment_b.xml AndroidManifest.xml When orientation changes - how do we remember the state of Fragment A…

Continue Reading 4) Getting fragments to talk to each other

3) Adding fragments using Java code

The Fragment Manager Every activity has its own Fragment Manager which is accessible through the method: getFragmentManager() The Fragment Manager maintains references to all the fragments within an activity. You…

Continue Reading 3) Adding fragments using Java code

1) Fragment Life Cycle

To make a fragment we have to: 1) Extend the fragment class 2) Give the appearance in XML or Java 3) Override the onCreateView() method to link appearance 4) Use…

Continue Reading 1) Fragment Life Cycle