If the onActivityForResult
isn't working well for you (as @CommonsWare suggested, it's fine) you can create a simple flow that should work fine:
In your activity, add
private boolean isReturnedFromSettings = false;
When you decide there's no internet connection and want to open the settings activity, use startActivity
and set isReturnedFromSettings = true;
In your Activity's onResume, add this:
if (isReturnedFromSettings) {
isReturnedFromSettings = false;
//DO WHATEVER
}
Should work...