Android应用程序在主菜单中出现了两次主菜、两次、应用程序、出现了

2023-09-05 02:57:41 作者:戒酒的李白

我写了一个Android应用程序,我运行它之后,就出现了两次主菜单。我的意思是,有两个图标此应用,但只有一个可以是开放

I wrote an android application and after I run it, it occurs twice in main menu. I mean, there are two icons for this application, but only one could be open.

如果我卸载该应用程序,我发现应用程序列表中只有一项。

If I deinstall this application, I find only one entry in the application list.

这是相同的,如果应用程序在模拟器或手机上运行。我没有这个问题,我的其他应用程序。

It's the same, if application's running in simulator or on phone. And I don't have this problem with my other applications.

任何想法???

感谢很多提前。

穆尔

推荐答案

如果你看到你的应用程序的两倍,您可能有两个意图在你的清单文件与发射类别(请确保您有只有一个),或者更改了在整个开发过程中你的包/类的名称。既然你说卸载它消除了一个副本,我很想怀疑后者。

If you see your app twice, you either have two intents in your manifest file with the LAUNCHER category (make sure you have only one), or you changed the name of your package/class throughout the development process. Since you said that uninstalling it removes one copy, I'm tempted to suspect the latter.