user631854
user631854

Reputation:

how to reload Reloading tabs every time

I have to add some tab,or edit the name of the tab to the tab widget.Now i want to reload the tabs every-time when any change in tabs occurs.For this purpose i have made a method and call that each-time when any change in tabs occur.Now my problem is that the method is not working after clearAlltabs() line after second time.First time the same code running properly.. Please Help me..

Upvotes: 2

Views: 454

Answers (1)

Anup Rojekar
Anup Rojekar

Reputation: 1103

intentLog = new Intent().setClass(this, ClassName.class);
        specLog = tabHost.newTabSpec("Log").setIndicator("Log",
                res.getDrawable(R.drawable.list)).setContent(
                **intentLog.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)**);
        tabHost.addTab(specLog);

you need to add one flag as Intent.FLAG_ACTVITY_CLEAR_TOP serves your purpose.

Please dont forget to mark as an answer if you find it useful..

Upvotes: 2

Related Questions