Android – How to reload the Tab activity when the tab changes

android

how to reload the activity when tab is select again? please give me a example code..when i press the tab it give me old output but i want to reload that activity for new updated output so please help me Thanks a lot.

Best Solution

Just use .addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP) to your tab class

Example

 tabHost.addTab(tabHost.newTabSpec("Your Tab")
        .setIndicator("tab indicator")
        .setContent(new Intent(this, TabClass.class)
        .addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)));