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

后端 未结 4 602
不思量自难忘°
不思量自难忘° 2021-02-11 07:22

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:57

    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

    
       
       
       
       
    
    

提交回复
热议问题