开发者

How can I launch an activity in another apk?

HI,

I have 2 projects (each has its own apk). Can you please tell me how can I launch an activity which is in another apk that I created? I have this activity which I want to launch from another project: 开发者_运维百科 // what should I put in here so that I can launch this from another activity in another project?


You would have to implement an Intent interface. I.e. have your activities respond to specific Intents specified via Intent-filters in your manifest. Have a look at this page:

http://android-developers.blogspot.com/2009/11/integrating-application-with-intents.html


Intent myIntent = new Intent();
myIntent.setClassName("com.activity1", "com.activity2");
startActivity(myIntent);

Activity 1 is the activity that is already running. Activity 2 is the com name of the activity you want to launch.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜