title: Why startActivityForResult not returning any result from AlarmClock.ACTION_SET_ALARM intent?
body: <p>I'm trying to set alarm using my app and for that I'm using Alarm Clock Common Intent as described <a href="https://developer.android.com/guide/components/intents-common.html#CreateAlarm" rel="nofollow noreferrer">here</a>.</p>
  
  <p>Here's my code:</p>
  
  <pre><code>public void createAlarm(String message, int hour, int minutes) {
          Intent intent = new Intent(AlarmClock.ACTION_SET_ALARM)
                  .putExtra(AlarmClock.EXTRA_MESSAGE, message)
                  .putExtra(AlarmClock.EXTRA_HOUR, hour)
                  .putExtra(AlarmClock.EXTRA_MINUTES, minutes)
                  .putExtra(AlarmClock.EXTRA_SKIP_UI, true);
          if (intent.resolveActivity(getPackageManager()) != null) {
              startActivityForResult(intent, SET_ALARM_REQUEST_CODE);
          }
  }
  </code></pre>
  
  <p>Here's <code>onActivityResult()</code>:</p>
  
  <pre><code>protected void onActivityResult(int requestCode, int resultCode, Intent data) {
          if (requestCode == SET_ALARM_REQUEST_CODE) {
              if (resultCode == RESULT_OK) {
                  if (data != null) {
                      Toast.makeText(getBaseContext(), "Alarm for " + data.getData().toString() + " has been set successfully!", Toast.LENGTH_SHORT).show();
                  } else {
                      Toast.makeText(getBaseContext(), "data is null", Toast.LENGTH_SHORT).show();
                  }
              } else {
                  Toast.makeText(getBaseContext(), "resultCode not OK", Toast.LENGTH_SHORT).show();
              }
          }
  }
  </code></pre>
  
  <p>The problem here is that I'm getting this <code>Toast</code> message: <code>resultCode not OK</code>.</p>
  
  <p>So, why <code>startActivityForResult</code> is not returning any result?</p>