This example shows you how to communicate between android fragment and activity and how to transfer data between different fragments in the android application.
This example shows you how to implement a simple news app use RecyclerView, Fragment, Qualifier, PercentRelativeLayout etc. If you do not know how to use those android widget, you can read previous articles about them. I will list all the related article at the end of this example.
There are a lot of android devices with different screen sizes and resolutions. This article will tell you how to make an android program load layout files dynamically based on the device’s screen resolution or size at run time.
Fragment can has it’s own menu, the fragment menu items are also displayed in android application action bar. This article will show you how to add menu items in android fragment and how to use fragment menu items with activity menu items.
Android fragment belongs to activity. Like activity, fragment also has it’s own life cycle. In one fragment life cycle, there are four states, running state, pause state, stop state, and destroy state. Each state has it’s own call-back method in fragment class.
The android activity provides a method to save/retrieve instance state data. Please read the article Android Save Retrieve Activity Instance State Example to learn more. The fragment also provides a method for you to save/retrieve related instance state data. This article will show you an example of how to save/retrieve instance state data in android …
Android OS provides a back stack function for Activity, it also provides the back stack function for Fragment. If you add one Fragment into the back stack, when you press the android device back menu, you can find the Fragment that is saved in the back stack popup. Until all the saved Fragments in the …
The fragment is widely used in android app development. You can use it statically or dynamically. Article Android Multiple Fragments In One Activity Example has introduced what it is and how to use Fragment statically. This article will tell you how to use it dynamically in your android app.
There are so many android devices in the world today. Different device screen sizes are also different. So when you create an android app, you must want it can be run in both small size ( android phone ) and big size ( android pad ) devices use only one release build.