i have a TabHost
in my MainActivity.java
. i want to reload my activity on condition which i give in code. Then i check internet connection because i want response from WebService
. Now Question is That how i can reload my activity on tab change and want to run my AsyncTask
which is in my User.java
. Onresume()
OnWindowFocusedChange
did not work for me.
mTabHost.setOnTabChangedListener(new OnTabChangeListener() {
@Override
public void onTabChanged(String tabId) {
// TODO Auto-generated method stub
if (refreshSession.equals("yes")) {
isInternetPresent = cd.isConnectingToInternet();
// check for Internet status
if (isInternetPresent) {
// Internet Connection is Present
// make HTTP requests
/**
* what to do here ?????
*/
} else {
// Internet connection is not present
// Ask user to connect to Internet
showAlertDialog(getParent(), "No Internet Connection", "You don't have internet connection.", false);
}
}
}
});
Thanx for any help :)