thanks advance..
when i create custom tab in android application so no one tab display in main screen
how to solve this problem please any one tell me?
you mean that you want to create custom tab for your application.ok now you have two class that is homemyclass.java and myclass.java. At first you declare flowing two line in homemyclass.java
private Intent mytab;
private static final String TAB_MYCLASS = "myclass";
then you write flowing line into onCreate() function of homemyclass.java
mytab = new Intent(this, myclass.class);
addTab(TAB_MYCLASS, getString(R.string."label for tab"), R.drawable."icon for tab display when
tab is selected", R.drawable."icon for tab display when tab is not selected", mytab);
just add addTab() into homemyclass.java
private void addTab(String tag, String label, int icon, int ficon, Intent content) {
TabHost tabHost = getTabHost();
TabSpec tabspecDialer = tabHost.newTabSpec(tag).setContent(content);
//boolean fails = true;
tabspecDialer.setIndicator(label, getResources().getDrawable(icon));
tabHost.addTab(tabspecDialer);
}
you also need to modify androidManifest.xml by homemyclass.java and myclass.java
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With