In myActivity, This is my code to check if my phone connect to the Internet or not.
if (!isConnected()) {
// super.playingVideo.setVideoUrl(product.getVideoUrl());
String message = getResources().getString(R.string.wifi_prompt);
super.showDialog(this, message, R.string.wifi_setting,
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog,
int which) {
if (dialog != null) {
dialog.dismiss();
}
currentProduct = product;
isViewRequest = true;
startActivity(new Intent(
android.provider.Settings.ACTION_WIRELESS_SETTINGS));
}
}, R.string.back, dismissDialogListener);
} else {...}
And to the resume:
@Override
protected void onResume() {
// After setting wifi
if (isViewRequest) {
...//mycode
}
super.onResume();
}
My problem is, when I've done setting wifi connection and press back button. It back to the menu screen of my phone, not resume myActivity.
Only if I launch my app again after that, the onResume() function is executed.
So, what's my missing to back to my app after setting wifi?