简体   繁体   中英

Launching activity from another application not displaying the activity, but it is running

I've done a lot of searching for the last day and haven't found anything that seems to match the problem I'm having.

(For reasons I won't go into) the app is divided into two separate apks. Each have activities. Only the "core" apk has a MAIN activity that is launched from the Android Launcher. The "plugin" apk has activities that only exist to be called from the first apk's activities and does not have a Launcher icon.

The issue I'm having is that when I create an intent to launch an activity from the "plugin" apk, it does the "launching new activity" sliding animation but immediately bounces back. But it is actually launching the activity because I'm seeing log statements in logcat coming from the new activity. I'm not getting any exceptions and it seems to be working other than the fact I'm not seeing the activity on the screen.

I've tried creating the intent in both of the following ways:

Intent myIntent = new Intent(Intent.ACTION_VIEW);
myIntent.setClassName("com.test.plugin", "com.test.plugin.PluginActivity");
startActivity(myIntent);

and

Intent myIntent = new Intent();
myIntent.setComponent(new ComponentName("com.test.plugin", "com.test.plugin.PluginActivity"));
startActivity(myIntent);

But both result in the same thing happening as described above.

它反弹回来意味着插件活动在启动时有问题。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM