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
6
votes
5 answers

How to make oval shape tabhost in android

I tried to make oval shape tabhost as expected below shape. I tried the below codes. public class AndroidTabLayoutActivity extends TabActivity { TabHost tabHost; @Override public void onCreate(Bundle savedInstanceState) { …
6
votes
1 answer

How can I use a wrap a TabHost containing a MapView that also displays an AdMob view below it?

I'm very new to Android (like 2 days), but I'm experienced with other layout toolkits. I'm trying to put an AdView below a TabHost, and it seems that I can either get the TabWidget or the AdView to display correctly, but never both. First, here's an…
Martin
  • 2,815
  • 1
  • 21
  • 30
6
votes
4 answers

Different sized tabs in Android

I have an application with 4 tabs. By default every tab width is 1/4 of the screen width. How can I override this? I need the tabs to have a different width for each one. Any ideas on how to accomplish that?
momo
  • 106
  • 1
  • 5
6
votes
2 answers

Create Smaller Tabs in Android

I am trying to create smaller tabs in android -- but I can't seem to get it to work because all that happens when I create a smaller tab is that it shows the bigger tab -- but without a drawable. This is my layout code for tabs now -- but the…
hwrdprkns
  • 7,525
  • 12
  • 48
  • 69
6
votes
1 answer

TabHost not showing in the screen

I'm trying to use TabHost on my app, and I simply dragged it to my activity using the design, but when I run it, it just won't appear, just get the white screen, does anyone knows why?
Bruno Braga
  • 570
  • 2
  • 4
  • 13
6
votes
3 answers

Show a progress bar on a child tab until the WebView loads

In an Android app I am using a TabView and one of the tabs shows a WebView. But the page is blank until the web page loads. How would one show a progress bar until the page loads? It cannot be in the title bar because that is hidden by the tab host.
brian
  • 61
  • 1
  • 1
  • 2
6
votes
2 answers

Android L Preview Material styled Tabs

In the new Design guidelines (scroll down to the bottom) you can see how tabs should look in the new Material design. TabHost however still looks very Holo to me, with no bottom line animation and no ripples effect. Is it something we have to…
6
votes
1 answer

How can I style Android tabs to get 3d look?

I want to create an Android tab view to look like this image: I guess there are many ways to Rome, but I think I still haven't found the ideal one. My idea was to cut out a divider and an active divider and place them between the buttons. However,…
Bart Burg
  • 4,786
  • 7
  • 52
  • 87
6
votes
4 answers

Android Tab Help. How to set 2nd tab as default when app opens?

I have created an app with 3 tabs. The app works fine but I want the 2nd tab to be selected and loaded when the app opens. How can I set that? Here is my code : public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); …
Praneeb Karat
  • 73
  • 1
  • 3
  • 10
6
votes
2 answers

Creating custom tabhost like in chrome browser for Android

I want to create custom tabhost for browser like tabs. I am confused about how to apply it for a layout like in chrome browser tab as in the image. Here is what I have tried. I want to know how to create that edges with slope as in the…
intrepidkarthi
  • 3,104
  • 8
  • 42
  • 75
6
votes
2 answers

Android FragmentTab host and Fragments inside Fragments

I have an app with hierarchy like this: FragmentTabHost (Main Activity) - Fragment (tab 1 content - splitter view) - Fragment (lhs, list) - Framment (rhs, content view) - Fragment (tab 2 content) - Fragment (tab 2 content) All…
6
votes
1 answer

Custom Back Stack for each Fragment in TabHost in Android

Since the TabActivity is deprecated I tried to replace it with Fragments which has been already mentioned in developer android website. But as you guys already know there was an issue about replacing tabs with fragments, since there will be only one…
osayilgan
  • 5,873
  • 7
  • 47
  • 68
6
votes
1 answer

How to finish an Activity that is used in a TabSpec, as the child of TabHost

I have Main Activity which contains a TabHost. In the TabHost I have several TabSpec which use an Intent for the content of the tab. At certain points in my code I need to remove a tab from the TabHost, and finish the Activity that was in that tab's…
plevintampabay
  • 550
  • 4
  • 18
6
votes
2 answers

How to launch an activity with a specific tab?

I've gone through many examples, questions and tutorials but I've never seen an activity launch (launch a new intent) with a specific tab. I know that one can use .setCurrentTab to switch to a tab, but this can be done only from inside the parent…
Harsh
  • 487
  • 3
  • 9
  • 29
6
votes
2 answers

Android tabHost and tabWidget icon issue

I'm working on an Android Application which uses the Tab Host icons downloaded from internet and Icon size is 30x30. for(int i = 0; i < titleNames.size(); i++) { intent = new Intent().setClass(context, Gallery.class); sp =…
osayilgan
  • 5,873
  • 7
  • 47
  • 68