Skip to main content

Posts

Android TabLayout select first Tab on Startup

https://stackoverflow.com/questions/37072902/android-tablayout-select-first-tab-on-startup @Override protected void onResume () { super . onResume (); mTabLayout . getTabAt ( 1 ). select (); mTabLayout . getTabAt ( 0 ). select (); } dfs d https://abhiandroid.com/materialdesign/tablayout-example-android-studio.html Example 1 of TabLayout: Below is the first example of TabLayout in which we display three non-sliding tabs. In this example we define a TabLayout and a FrameLayout in our xml file. In this example we create and add 3 tabs in the TabLayout with the help of different methods of TabLayout. After that we implement setOnTabSelectedListener event and replace the FrameLayout with the fragment’s according to selected tab. Download Code (Password: abhiandroid) Step 1:  Create a new project and name it TabLayoutExample Step 2:  Open build.gradle and add Design support library dependency. apply plugin : 'c...