Android Error Cant Use FLAG_RECEIVER_BOOT_UPGRADE here

前端 未结 3 1707
陌清茗
陌清茗 2021-01-12 21:41

I am trying to start AppB from AppA. On activity of AppB I issue:

Intent i = new Intent();
             i.setAction(\"START_APPB\");
             i.addFlag         


        
相关标签:
3条回答
  • 2021-01-12 22:10

    I ran into this and found out that this is a bug in android. At some point in history this two flags - FLAG_ACTIVITY_NEW_TASK and FLAG_RECEIVER_BOOT_UPGRADE - get the same numeric value because some android developer changed one of their values without checking that it is already taken by another flag. The latest version (4.4) seems to have it fixed already.

    0 讨论(0)
  • 2021-01-12 22:24

    Do not use any FLAG_ACTIVITY_ constant with sendBroadcast().

    0 讨论(0)
  • 2021-01-12 22:32

    When populating your Intent, do:

    intent.setFlags(0);
    
    0 讨论(0)
提交回复
热议问题