Skip to content Skip to sidebar Skip to footer

Why StartActivityForResult Not Returning Any Result From AlarmClock.ACTION_SET_ALARM Intent?

I'm trying to set alarm using my app and for that I'm using Alarm Clock Common Intent as described here. Here's my code: public void createAlarm(String message, int hour, int minut

Solution 1:

That Intent action is not documented to return anything. Hence, implementations do not need to use setResult(), and so you are getting the default response.

Replace your startActivityForResult() with startActivity(), and remove your result-processing code from onActivityResult() tied to that startActivityForResult().

BTW, replace all your getBaseContext() calls with this.


Post a Comment for "Why StartActivityForResult Not Returning Any Result From AlarmClock.ACTION_SET_ALARM Intent?"