@Test public void handleIntent_SendIntentException() throws IntentSender.SendIntentException { doThrow(new IntentSender.SendIntentException()).when(status).startResolutionForResult(activity, LocationSettingsActivity.REQUEST_CODE_RESOLUTION); activity.handleIntent(); }
void handleIntent() { Status status = getIntent().getParcelableExtra(ARG_STATUS); try { status.startResolutionForResult(this, REQUEST_CODE_RESOLUTION); } catch (IntentSender.SendIntentException | NullPointerException e) { setResolutionResultAndFinish(Activity.RESULT_CANCELED); } }
LocationSettingsActivity extends Activity { void handleIntent() { Status status = getIntent().getParcelableExtra(ARG_STATUS); try { status.startResolutionForResult(this, REQUEST_CODE_RESOLUTION); } catch (IntentSender.SendIntentException | NullPointerException e) { setResolutionResultAndFinish(Activity.RESULT_CANCELED); } } }
LocationSettingsActivity extends Activity { void handleIntent() { Status status = getIntent().getParcelableExtra(ARG_STATUS); try { status.startResolutionForResult(this, REQUEST_CODE_RESOLUTION); } catch (IntentSender.SendIntentException | NullPointerException e) { setResolutionResultAndFinish(Activity.RESULT_CANCELED); } }  }
LocationSettingsActivity extends Activity { void handleIntent() { Status status = getIntent().getParcelableExtra(ARG_STATUS); try { status.startResolutionForResult(this, REQUEST_CODE_RESOLUTION); } catch (IntentSender.SendIntentException | NullPointerException e) { setResolutionResultAndFinish(Activity.RESULT_CANCELED); } }   }
LocationSettingsActivity extends Activity { void handleIntent() { Status status = getIntent().getParcelableExtra(ARG_STATUS); try { status.startResolutionForResult(this, REQUEST_CODE_RESOLUTION); } catch (IntentSender.SendIntentException | NullPointerException e) { setResolutionResultAndFinish(Activity.RESULT_CANCELED); } }    }