Code to launch external app explicitly

后端 未结 6 897
闹比i
闹比i 2020-12-01 14:21

From one of my apps, I\'m trying to launch another. I want to use an explicit intent.

ComponentName cn = new ComponentName(\"com.myOtherApp\", \"OtherAppActi         


        
6条回答
  •  悲哀的现实
    2020-12-01 14:54

    Create the intent as action.Main and add the launcher category to it:

    Intent intent = new Intent("android.intent.action.MAIN");
    intent.addCategory("android.intent.category.LAUNCHER");
    

提交回复
热议问题