eclipse - What is the proper way to add an icon to a tab to a TabHost for Android? -


i'm new android development.

i've added tabhost android application, , can change text of 3 tabs have fine. can click them show different views, etc.

but , how add icon specific tab? not change programmatically, add on layout design? in xml or using designer somehow?

do below:

 tabhost tabhost=gettabhost(); tabhost.tabspec spec; tabhost.tabspec spec=tabhost.newtabspec("hello").setindicator("hello",getresources().getdrawable(r.drawable.ic_launcher)).setcontent(intent); tabhost.addtab(spec); 

this easiest way to set icon secific tab.


Comments

Popular posts from this blog

javascript - backbone.js Collection.add() doesn't `construct` (`initialize`) an object -

php - Get uncommon values from two or more arrays -

Adding duplicate array rows in Php -