Two main activities in AndroidManifest.xml

后端 未结 3 892
长发绾君心
长发绾君心 2020-11-30 09:04

I would like to have two main activities in my app. So in my manifest I put:



        
3条回答
  •  一生所求
    2020-11-30 09:28

    The LAUNCHER intent filter is what determines what shows up in the app drawer/launcher. That is why you get two icons shown up.

    However, you also set the DEFAULT intent filter, which sets the default Activity for the whole package. Since you set it twice, you get the problem of precedence of the first/latest registered. When you remove the DEFAULT filter, you will be able to start whatever you click on in the launcher.

    In short, remove the following line from both Activities:

     
    

提交回复
热议问题