Android App activities installed as multiple icons

前端 未结 3 1562
不思量自难忘°
不思量自难忘° 2020-12-09 01:32

My Android App has 2 activities. A login screen and a search screen. When I deploy the app on emulator or on my device, I see 2 icons for same app. When I click on icon 1 it

3条回答
  •  -上瘾入骨i
    2020-12-09 01:52

    The comment made by @Adrian C on his answer solved our problem.

    The manifest file of our main application had only one intent-filter tag specifying only one activity as the launcher activity for the application.

    So I had to look deeper...

    We included library projects (luckily written by us) and the manifest file of one of the library projects had an intent-filter tag on its activity specifying that activity as the launcher activity.

    When we then included that library project in our main application (which has its own intent-filter specifying a launcher activity), the complete source code saw two intent-filter tags specifying two activities as launcher activities and therefore two application icons were created.

    When we removed the intent-filter specifying a launcher activity in the library project, the second app launcher icon disappeared.

提交回复
热议问题