Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to Change Label of TabHost Programmatically/Dynamically
    primarykey
    data
    text
    <p>I have a tabhost created by</p> <pre><code> this.tabHost = getTabHost(); // Resusable TabSpec for each tab Intent intent; // Reusable Intent for each tab // Create an Intent to launch the first Activity for the tab (to be reused) intent = new Intent().setClass(this, FirstGroup.class); // Initialize a TabSpec for the first tab and add it to the TabHost spec1 = tabHost.newTabSpec("FirstGroup").setIndicator("Regionlar", getResources().getDrawable(R.drawable.region2)) // Replace null with R.drawable.your_icon to set tab icon .setContent(intent); tabHost.addTab(spec1); </code></pre> <p>And I want to change label of tabhost programmatically: "Regionlar" to "newMenuTabbar". I couldn't find any example. thanks for attention. </p> <p>Edit: I want to change second tabitem's label from "Mənzərələr"=> "secondTabitem" </p> <p>intent = new Intent().setClass(this, FirstGroup.class);</p> <pre><code> // Initialize a TabSpec for the first tab and add it to the TabHost spec1 = tabHost.newTabSpec("FirstGroup").setIndicator("Regionlar", getResources().getDrawable(R.drawable.region2)) // Replace null with R.drawable.your_icon to set tab icon .setContent(intent); tabHost.addTab(spec1); // Create an Intent to launch an Activity for the tab (to be reused) intent = new Intent().setClass(this, SecondActivityGroup.class); spec2 = tabHost.newTabSpec("SecondActivityGroup").setIndicator("Mənzərələr", getResources().getDrawable(R.drawable.img_gallery_icon)) // Replace null with R.drawable.your_icon to set tab icon .setContent(intent); tabHost.addTab(spec2); </code></pre>
    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.
 

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