开发者

How to start an activity that is defined in other Android projects?

开发者 https://www.devze.com 2023-02-13 13:14 出处:网络
I have defined some common Activities in a library project and want to reuse these activity in my working project.

I have defined some common Activities in a library project and want to reuse these activity in my working project.

I declared my library project as Android library, use the fully-qualified name of the Activities and declare them in the AndroidMan开发者_如何学运维ifest.xml of the new project. However, I get 'Unable to find explicit activity class' error when launching the application.

Any other configurations shall I do in order to start the Activities?


Either your activity is not in your manifest, or there is some problem with your library project causing the activity class to not be included in the APK.


You need to use Implicit Intent and Intent Filters, check this blog entry and the android documentation for more information.

I have made a very simple sample (quick and dirty but working here): http://dl.dropbox.com/u/5289718/DummyIntent.zip

0

精彩评论

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

关注公众号