Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

进入插件的其他界面 #336

Closed
Android-sunshine opened this issue Apr 1, 2017 · 3 comments
Closed

进入插件的其他界面 #336

Android-sunshine opened this issue Apr 1, 2017 · 3 comments

Comments

@Android-sunshine
Copy link

可以进入插件的主界面,但是怎么样才能从宿主中直接进入插件的其他界面呢(非主界面)。
我再插件中添加了action然后 按照如下调用,是崩溃的。即使在插件里加入DEFAULT和LAUNCHER也不行。
Intent intent = new Intent("this is plugin action")
intent.putExtra("name", "name");
startActivity(intent);

如果按照如下调用,进入的是主界。。。。
PackageManager pm = getPackageManager();
Intent intent = pm.getLaunchIntentForPackage(“this is plugin packagename”);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.setAction("this is plugin action");
intent.putExtra("name", "name");
startActivity(intent);

公司的项目需要,挺急的 望解答 感谢

@Android-sunshine
Copy link
Author

@cmzy @htynkn @markzhai @JackCho @tiann 叨扰各位了

@JackCho
Copy link
Contributor

JackCho commented Apr 1, 2017

在插件的LauncherActivity里面进行页面分发,通过宿主intent传递过来的数据进行区分

@Android-sunshine
Copy link
Author

试了隐式调用广播 失败
隐式调用服务 失败(5.0之后不可隐式调用)

采用LauncherActivity里面进行页面分发 感谢您的解答 @JackCho

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants