I am stuck with a problem where I have designed a tab layout that I have used as a library in the current project which has a Recycler View. I want to show the tab layout on top and the recycler view under the tab layout. For reference in Whatsapp, there is tab layout under which there is a recycler view that shows all the messages. Problem is that I am confused about how to combine both activities together so the user can use the tab layout. If anyone knows any solution please help!!
Asked
Active
Viewed 49 times
0
-
You can't, use fragments instead – Zain Jan 06 '23 at 23:47
-
see this link for reference of creating tablayout in android : https://developer.android.com/guide/navigation/navigation-swipe-view – daya pangestu Jan 09 '23 at 07:28
1 Answers
1
Use single-activity pattern. This pattern means that you need to use Fragments in a single activity (MainActivity, etc). Additional tip, you can use ViewPager2 with TabLayout for your Fragments.
Activities can't be composed into one, cause it designed so.

Exc_U
- 11
- 3