Code to launch external app explicitly

后端 未结 6 883
闹比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:34

    Try something like this...

    In the manifest for 'myOtherApp' use an intent filter for 'OtherAppActivity' with a company specific intent, example...

    
        
            
        
    
    

    Then, in the 'calling' app, use...

    Intent intent = new Intent();
    intent.setAction("com.mycompany.DO_SOMETHING");
    context.startActivity(intent);
    

提交回复
热议问题