I have used tab activity with tabhost in my application. But after discovering about other ways to go about forming tabs,i was wondering if using tabactivity is the wise choice for the application. I am new to android and curious to know if there are better ways to achieve non-swipeable tabs(without actionbar).
Asked
Active
Viewed 111 times
1 Answers
1
It would be best to use TabLayout included in the support design library release and follow the material design specs. That's pretty standard and accepted way now. If you want to have non swipeable tabs, you can disable swipe as described here.
-
1thanks @random . I have listview under the tabs and the support library seems to have some bugs presently which are not addressed yet. As in the tabs goes invisible as we click on another. I tried working on it already.If you have any better suggestion, i would love to look into it, – Devs Sep 20 '15 at 07:18
-
I have used `TabLayout` in my app and not seen that bug. Can you check chrisbane's `CheeseSquare` sample project for `TabLayout`, it too had tabs with listview underneath in the form of `recyclerview`s – random Sep 20 '15 at 08:08
-
you might want to check this out https://code.google.com/p/android/issues/detail?id=180462 and this stackoverflow.com/questions/31539958/tablayout-missing-after-updating-design-support-library – Devs Sep 20 '15 at 08:11
-
Well ok. But still feel it might be a better option with workaround till you have a new release than using TabActivity – random Sep 20 '15 at 08:31
-
I somehow don't understand the workaround and it doesn't even work for me. All i want to know is, is it okay to still use tab activity? it would be helpful if you can give opinion. :) – Devs Sep 20 '15 at 08:41
-
`TabActivity` is deprecated so I won't recommend it. You may try an older version 22.2.0 of the support library. I think in one of the comments in the issue it was mentioned the older version doesn't have that bug. `TabActivity` won't have same level of support as `TabLayout` will have. – random Sep 20 '15 at 08:44