When I try to do a TabHost with an icon and a text, Only the text is visible, if I left the text in blank it is possible to see the icon. I want to see both on screen. I tried to do it with a Layout and an Inflater without success. Could you please check what is wrong in my code?
TabHost tabHost = (TabHost)findViewById(R.id.tabHost);
Intent intent = new Intent(this,activity1.class);
TabHost.TabSpec tabSpec1 = tabHost.newTabSpec("SMS");
View tabIndicator = LayoutInflater.from(this).inflate(R.layout.tab_layout, tabHost.getTabWidget(), false);
TextView title1 = (TextView) tabIndicator.findViewById(R.id.my_text);
title1.setText("SMS");
ImageView icon1 = (ImageView) tabIndicator.findViewById(R.id.my_image);
icon1.setImageResource(R.drawable.ajout);
tabSpec1.setIndicator(tabIndicator);
tabSpec1.setContent(intent);
tabHost.addTab(tabSpec1);
Intent intent1 = new Intent(this, activity1.class);
TabHost.TabSpec spec2 = tabHost.newTabSpec("MMS");
View tabIndicator1 = LayoutInflater.from(this).inflate(R.layout.tab_layout, tabHost.getTabWidget(), false);
TextView title2 = (TextView) tabIndicator.findViewById(R.id.my_text);
title2.setText("MMS");
ImageView icon2 = (ImageView) tabIndicator.findViewById(R.id.my_image);
icon2.setImageResource(R.drawable.suppression);
spec2.setIndicator(tabIndicator1);
spec2.setContent(intent1);
tabHost.addTab(spec2);