Android Fragments
In Android, there are different types of devices having different sizes and different hardware designs. To introduce modularity and reusability of the activity’s UI, Fragments were introduced. Fragments are called as reusable UI components who have their own layout, lifecycle and can handle its own input events. They very similar to how Activity functions in Android. Major difference is that Fragment provides the required flexibility to update the UI design in an easier way. Unlike Activity, Fragments can easily be added, removed and can easily enter or exit provided screen space. Let's have an example News Application. Assume the app has 2 screens: 1. List of News items 2. Details of each new item (open when an news items is clicked in #1 screen) Generally, having 2 activities for each of these screens will be the first possible approach. For phone devices (where width is smaller) this approach can be considered and implemented. But for the devices with larger w...