This week's book giveaway is in the Web Services forum.
We're giving away four copies of Microservices in Action and have Morgan Bruce & Paulo A. Pereira on-line!
See this thread for details.
Win a copy of Microservices in Action this week in the Web Services forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

Creating multiple tabs :one after another  RSS feed

 
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
In my application, i want to create multiple tabs.
For example, i have a button on clicking which should create one more tab,(just like mozilla browser).
I searched on Internet as well as Android Documentation.. but did not get any clue...

Can anybody please help me..??
 
Author
Posts: 131
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
http://developer.android.com/guide/tutorials/views/hello-tabwidget.html

 
Prajkti Khadse
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Mark,
I already referred that...
What i want actually is to create a new tab when user Clicks on "New Tab" menu or button..

Is it really possible??
 
Ranch Hand
Posts: 136
Android Chrome Mac
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Prajakti,

Here it is,

Main class - TabActivityDemo


Layout - tabview.xml

Tab layout class - ChildTab


Just modify according to your requirement.
Have fun!!!

Thanks & Regards
Pratik Goswami
 
Prajkti Khadse
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Pratik,
one more question...

can we change title (i.e indicator) of tab on particular event??
i mean once the tab is added to TabHost, is it possible to modify it??
 
Pratik Goswami
Ranch Hand
Posts: 136
Android Chrome Mac
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have created a multiple instances of a single TabSpec object, you can create multiple objects of TabSpec fit to your requirement. After creating object you can change their property at specific event. You can create TabSpec's object array and add them with a loop. Apply your own logic to mess up with tab bar.


Thanks & Regards
Pratik Goswami
 
Prajkti Khadse
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks,
i'l try it..
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!