How to start an activity in an android Application from the Library

后端 未结 4 570
眼角桃花
眼角桃花 2021-02-11 07:24

I have an Android application in Android Studio. And I\'ve added a library into the application. The button, view, and activities are defined in the library. When I click on the

4条回答
  •  花落未央
    2021-02-11 07:53

    In this case use Implicit Intent

    Inside library Activity TESTActivity :

    Intent intent = new Intent();
    intent.setAction("com.myapp.myimplicit_action");
    startActivity(intent);
    

    and here is my manifest file declaration for some activity say 'ImplicitActivity' with the same action

    
       
       
       
       
    
    

提交回复
热议问题