Combine android projects together

后端 未结 2 924
忘了有多久
忘了有多久 2020-12-16 07:35

I want to combine 2 android projects together in such a way that when an button is pressed from one activity (of 1st project ) it should start my activity from (2nd project)

2条回答
  •  清歌不尽
    2020-12-16 08:09

    If all you need is to show a new MainActivity instance you need to declare an intent-filter in your "2nd project" manifest:

     
       
         
         
       
     
    

    Then create an intent with the same action string in your first project:

    Intent intent = new Intent("your.package.here.MainActivity");
    startActivity(intent);
    

提交回复
热议问题