Dynamically Change Tab Name

Put your problem here if it does not fit any of the other categories.

Dynamically Change Tab Name

Postby dodsont » Mon Apr 04, 2011 11:21 pm

I am creating a tab with the following code:

Code: Select all
intent = new Intent().setClass(this, NameActivity.class);
        spec = tabHost.newTabSpec("title").setIndicator("Title",
                    res.getDrawable(R.drawable.ic_tab_name))
                    .setContent(intent);
        tabHost.addTab(spec);
       


I want to update this Title from an event in my app. is there anyway to do this?
dodsont
Freshman
Freshman
 
Posts: 3
Joined: Fri Mar 25, 2011 9:32 pm

Top

Re: Dynamically Change Tab Name

Postby strider2023 » Tue Apr 05, 2011 9:46 am

restart your android activity with the desired title name (save the cahnged title in a string before restarting)..

How to restart your activity: http://stackoverflow.com/questions/1397 ... d-activity
strider2023
Senior Developer
Senior Developer
 
Posts: 126
Joined: Tue Mar 02, 2010 6:34 am
Location: Chennai, India

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 15 guests