Using an Android library project Activity within another project

前端 未结 8 1401
余生分开走
余生分开走 2020-11-30 01:37

I have an Android library project that I would like to use from within another Android project.

The library has a Activity declared in its AndroidManifest. When I t

8条回答
  •  时光说笑
    2020-11-30 02:27

    Intent intent = new Intent(android.content.Intent.ACTION_VIEW);
    intent.setComponent(new ComponentName("packagename//ex-com.hello", 
                                         "classname//ex-com.hello.ExampleActivity"));
    startActivity(intent);
    

    And make sure in library you have declared the activities. You don't need to declare the library activities in your current project's manifest.

提交回复
热议问题