How to call an activity in another project?

前端 未结 5 687
无人及你
无人及你 2021-01-18 22:22

Hi I am new to android and I have created 2 projects.

Now I want to call an activity in the second project from the first project upon a button click.

The 1

5条回答
  •  不思量自难忘°
    2021-01-18 22:58

    This is really not a good way for developing any application. But still if you want to achieve this , you will have to declare an Intent Filter for the target activity in that application's Manifest file and use it as implicit intent from your login activity.

    Inside project A's Manifest:

    
                 
                    
                
    
    

    Inside project B's Activity:

    Intent intent = new Intent("com.someone.wants.to.call.me");
             startActivity(intent);
    

提交回复
热议问题