title: the purpose of setting an action when returning a result by setResult
body: <p>This is the example code from <a href="https://developer.android.com/training/basics/intents/filters.html#ReturnResult" rel="nofollow noreferrer">Training for Android developers</a></p>
  
  <pre><code> //Create intent to deliver some kind of result data
  Intent result = new Intent("com.example.RESULT_ACTION", Uri.parse("content://result_uri"));
  
  setResult(Activity.RESULT_OK, result);
  
  finish();
  </code></pre>
  
  <p>When we return a result from sub-activity, normally we only need to set Extra or Uri data. What's the  purpose of specifying a custom action here ?
  Update:</p>
  
  <p>Say we want to  open the Gallery app to select an image to use in our app.</p>
  
  <p>Invoking Gallery app</p>
  
  <pre><code>    Intent intent = new Intent();
      intent.setType("image/*");
      intent.setAction(Intent.ACTION_GET_CONTENT);
      startActivityForResult(Intent,PICK_IMAGE_REQUEST);
  </code></pre>
  
  <p>Returning the result</p>
  
  <pre><code>   Intent result = new Intent();              
     result.setData(_Uri.parse("content://result_uri");
     setResult(Activity.RESULT_OK, result);
     finish();
  </code></pre>
  
  <p>handling the result</p>
  
  <pre><code>@Override
  protected void onActivityResult(int requestCode, int resultCode, Intent data) {
      // Check which request we're responding to
      if (requestCode == PICK_IMAGE_REQUEST) {
          // Make sure the request was successful
          if (resultCode == RESULT_OK) {
               Uri imageUri = data.getData();
              // Do something with the image here 
      }
  }
  </code></pre>
  
  <p>I didn't set  "com.example.RESULT_ACTION" in the example code above.</p>