Questions tagged [android-tabhost]

Display a sub list of tab labels representing each page in the parent's tab collection.

Displays a list of tab labels representing each page in the parent's tab collection. The container object for this widget is TabHost. When the user selects a tab, this object sends a message to the parent container, TabHost, to tell it to switch the displayed page. You typically won't use many methods directly on this object. The container TabHost is used to add labels, add the callback handler, and manage callbacks.

Reference: Android Developers Tabhost

2122 questions
9
votes
3 answers

ViewPager inside Fragment loses content when returning to it

I am implementing tabhost using FragmentActivity , under the first tab i load a welcome fragment that contains a Viewpager and CirclePageIndIcator, I need to load 4 views in side that WelcomeFragment this is my WelcomeFragment public class…
9
votes
2 answers

TabHost - how to change tab text in XML

I know the solution on how to change it programically however I would like to set the text in XML. How do you do that? I have looked here: http://developer.android.com/reference/android/widget/TabHost.html but found no solution.
LucasSeveryn
  • 5,984
  • 8
  • 38
  • 65
9
votes
2 answers

TabHost with Activities vs. ActionBar with Fragments

I've found some discussions related to this issue but nothing clear or definitive. Building a tab-based application, one seems forced to choose between (A) using TabHost with Activities for each screen, and (B) using the ActionBar with Fragments…
Jonathan
  • 1,075
  • 2
  • 10
  • 18
9
votes
5 answers

Android: TabActivity deprecated, use Fragments?

It appears that TabActivity is now deprecated, we need to use Fragments. I tried using a standard Activity but couldn't call getTabHost. So it appears i have to use Fragments. But i am a little confused how this would work. I understand that…
Martin
  • 23,844
  • 55
  • 201
  • 327
8
votes
3 answers

Android TabHost inside Fragment

I am working on an Android App and I have used android FragmentPager tabs example from developer.android.com), this example uses fragments for tabs contents, Now I want to place a tabHost inside one of those fragments, I have tried my best but the…
8
votes
5 answers

Your content must have a TabHost whose id attribute is 'android.R.id.tabhost'

I have a problem: Java Code public class VisualizzaListaActivity extends TabActivity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); …
Matteo Cardellini
  • 876
  • 2
  • 17
  • 41
8
votes
3 answers

How to center text in tabhost?

I have a basic question. In many tabhost examples, we find tabs with image and text. In my case, I would like to only display a text, but the issue is that my text is horizontally centered but not vertically (The text is at the bottom of my tab). I…
Miroufle
  • 125
  • 2
  • 10
8
votes
2 answers

Looking for a universal TabHost style that will work on Android, HTC Sense, Samsung, etc. skins

The default style for the Android TabHost works fine for straight Android systems. However, on HTC Sense, they use dark text on a dark background, which is unreadable. What's the easiest way to have a TabHost that has visible text across all the…
emmby
  • 99,783
  • 65
  • 191
  • 249
8
votes
3 answers

Tab Layout tutorial incomplete?

I've been trying to implement the tab UI described in this tutorial: https://developer.android.com/resources/tutorials/views/hello-tabwidget.html I follow all the steps described in the process but I keep getting a runtime exception which I believe…
Bilthon
  • 2,461
  • 8
  • 36
  • 44
8
votes
4 answers

Issues with Android TabHost Example

I have been attempting to implement the 'advanced' tabwidget example from google. But, when it tries to call tabHost.addTab(spec); I get a stack trace from the debugger. Sorry, I don't have the stack trace here, but I'm wondering if others have…
KevinDTimm
  • 14,226
  • 3
  • 42
  • 60
8
votes
1 answer

Whats is the difference between actionbar and tabhost/tabactivity

Quick question, Whats the difference between actionbar and tabhost. I used to use tabhost and add tabs to it. Then I was asked to use actionbar and reading about it, it seems it is just another way of having tabs. So when would use each? Whats the…
Snake
  • 14,228
  • 27
  • 117
  • 250
8
votes
4 answers

Tab icon not showing

I'm trying to do a simple tab app in android with two tabs. My problem is that when I put this code, in the tab, only is shown the text, but no the icons. If I put the text to "" the icon is shown. Could someone help me? My android version is…
8
votes
4 answers

OnClickListener on Tabs not working

Greetings, I am trying to get the Click - event when clicking on the currently selected tab of my TabActivity. The onTabChangedHandler is only called whenever the tab is changed, not if the currently active Tab is clicked. The debugger tells me i…
Aracos
7
votes
5 answers

How to implement horizontally scrollable tabs?

I'm trying to implement this application. At the moment I have designed tabs on it and since I have more than 7 tabs it looks too congested. How can I design it so that the tabwidget is scrollable horizontally. I have seen this design on few of the…
user1187383
7
votes
1 answer

Android: NPE in TabSpec setContent(View)

I'm trying to set the content of a tab in my TabHost to be a RelativeLayout (defined in the top-level of one of my XML files). I've tried identifying it both by using R.layout.lobby_tab and R.id.lobby_base (the ID is added as an item in XML…
bgroenks
  • 1,859
  • 5
  • 34
  • 63