Permission Denial: startActivity asks to run as user -2 but is calling from user 0; this requires android.permission.INTERACT_ACROSS_USERS_FULL

前端 未结 5 940
遥遥无期
遥遥无期 2020-12-01 18:38

When I\'m trying to use android \'am\' command to start an activity ,it\'s wrong under 4.2 platform(I tried , it\'s ok under 2.3 version).The code is like this



        
5条回答
  •  Happy的楠姐
    2020-12-01 19:12

    As @juanmf mentioned in a comment, adding the --user 0 option to the command resolved the issue for me. The resulting command would look like this:

    am start --user 0 -a android.intent.action.VIEW -n com.android.browser/com.android.browser.BrowserActivity
    

提交回复
热议问题