Question

I am a novice in developing android app ! I am working with Android Studio! Want to implement a tab-panel in which some of the tabs (as this) will contain listview to hold some data or image from a json Webservice! While the data comes from internet connectivity so there is performance is a issue for me!

I have got two types of way to implement tabs in android! One is listactivity & other is fragment! I just want to know which of these two way is efficient for implementing tabs on android??

Was it helpful?

Solution

A listActivity is an activity, and you cannot bind a different activity to each tab-panel, but you can put a different fragment on each panel (or use a single container, and just replace the fragments there with transactions).

You can also use another fragment to display the tab-interface at the top, which remains constant as the contents below changes. Something you couldn't do if you were switching activities.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top