Android AlarmClock ACTION_SET_ALARM intent produces exception

前端 未结 2 1026
清酒与你
清酒与你 2021-01-13 05:48

The given example produces an Exception (android.content.ActivityNotFoundException: No Activity found to handle Intent)

Intent i = new Intent(AlarmClock.ACTI         


        
相关标签:
2条回答
  • 2021-01-13 06:06

    You need to set permission in manifest file also.

    <uses-permission android:name="com.android.alarm.permission.SET_ALARM"/>
    
    0 讨论(0)
  • 2021-01-13 06:10

    Do you have any ideas, what can be going wrong?

    The device does not support that activity. This is not unheard of. Either catch the exception and let the user know, or use PackageManager and queryIntentActivities() to see if anything will respond to your Intent in advance of calling startActivity().

    0 讨论(0)
提交回复
热议问题