This example show you how to communicate between android fragment and activity and how to transfer data between different fragments in 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 size and resolution. This article will tell you how to make android program load layout file 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.
Android activity provide method to save / retrieve instance state data. Please read article Android Save Retrieve Activity Instance State Example to learn more. Fragment also provide method for you to save / retrieve related instance state data. This article will show you an example about 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 saved Fragments in the back …
Fragment is widely used in android app development. You can use it statically or dynamically. Article Android Multiple Fragments In One Activity Example has introduce what 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 size are also different. So when you create an android app, of course you want it can be run in both small size ( android phone ) and big size ( android pad ) devices use only one release build.