Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>A couple possibilities come to mind. </p> <p>If you're using a TabActivity (not a requirement, but makes things easier), the tabhost must have <code>android:id="@android:id/tabhost"</code> as the id. </p> <p>I've also seen it said that the tabhost must be the root node. I cannot confirm that using the android docs. I'd probably make this change after all other avenues have failed (or someone confirms that it is true). </p> <p>If you are using a TabActivity, you don't need to reference the tabhost by id, or use the setup() method. I see you are using the setup() method, but I can;t tell if your activity is a TabActivity. If it is, maybe that's causing your issue.</p> <p>Following is the method I use for a tab layout setup and it works for me. Note that this assumes the tabhost as the root node of the layout and it has <code>android:id/tabhost</code> as the id and it is a TabActivity.</p> <p><strong>tabhost code:</strong></p> <pre><code>public class Tabs extends TabActivity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.your_layout); TabHost tabHost = getTabHost(); TabHost.TabSpec spec; spec = tabHost.newTabSpec("tag1").setIndicator("All").setContent(R.id.tab1); tabHost.addTab(spec); spec = tabHost.newTabSpec("tag2").setIndicator("Personal").setContent(R.id.tab2); tabHost.addTab(spec); } } </code></pre> <p>Hope this helps! (Be sure to click the check mark to accept the answer if it solves your problem).</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload