Android explicit intent with target component

后端 未结 5 1479
鱼传尺愫
鱼传尺愫 2020-12-09 03:45

Is it possible to fire explicit intent but not for an activity from my project but for activity in some other application.

I am sure of this code and I know it is ru

5条回答
  •  长情又很酷
    2020-12-09 04:37

    Yes it's possible. But creation of intent is different.Try this:

    Intent intent = new Intent();
    intent.setComponent(new ComponentName("The package name of the activity that you wish to launch","Its fully qualified class name"));
    startActivityForResult(intent);
    

提交回复
热议问题