title: How to handle the result of an Activity?
body: <p>I am starting the location services intent in order to get the location updates from the user:</p>
  
  <pre><code>Intent intent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);
  startActivityForResult(intent,100);
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/avBFm.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/avBFm.png" alt="enter image description here"></a></p>
  
  <p>I then try to check the <code>resultCode</code> inside onActivityResult method(for now I'm simply toasting):</p>
  
  <pre><code>@Override
  protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
     Toast.makeText(this, "Result Code: " + resultCode, Toast.LENGTH_SHORT).show();
  }
  </code></pre>
  
  <p>I was expecting the <code>resultCode</code> to show a different result if the user toggles the location on or off. However I only get 0 as the result.</p>
  
  <p>What criteria should I use to get whether or not the GPS was enabled?</p>