android - 如何在一个Module中调用另一个module中的Activity?
PHPz
PHPz 2017-04-17 17:32:16
0
3
1130

如题。在不添加依赖的情况下该如何在一个Module中调用另一个module中的Activity?
使用:

Intent intent = new Intent("myAction");
        intent.setClassName("packageName", "packageName+ActivityName");
        startActivity(intent);

会出现

android.content.ActivityNotFoundException: Unable to find explicit activity class 

求大神赐教!

PHPz
PHPz

学习是最好的投资!

reply all(3)
左手右手慢动作

If you don’t add dependencies, your module will not be compiled into your app. How can you find it? Obviously that's not possible.

小葫芦

Obviously you can’t do this, you can’t find it. Use implicit calls.

刘奇

1. There is a way to solve it. Using routing, all activities are registered in a routing table, and one key corresponds to one activity
2. Jump through the routing tool class

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template