Is it not possible to start an activity from BroadcastReceiver

前端 未结 2 1341
渐次进展
渐次进展 2021-01-26 23:43

I want to call this activity from a class extending BroadcastReceiver but its not working

Intent i = new Intent(DevicePolicyManager.ACTION_SET_NEW_PASSWORD);
co         


        
2条回答
  •  日久生厌
    2021-01-27 00:28

    Add the FLAG_ACTIVITY_NEW_TASK flag to your intent, eg:

    i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    

提交回复
热议问题