Android应用程序创建两个启动器图标 [英] Android Application creating two launcher icons

查看:225
本文介绍了Android应用程序创建两个启动器图标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在一段时间内正在开发的应用程序中遇到一个非常混乱的问题。突然,当我运行我的应用程序时,我发现一个紧急的力量在发射后关闭。



进一步调查后,我的发射器中发现了两个启动器图标。其中一个将恢复应用程序,如果它正在运行或强制关闭,如果它不运行。第二个将正常运行 - 正常启动应用程序并恢复正常。



我很困惑,因为我没有做任何事情(我可以​​想到)导致这个问题。我没有在清单中改变任何东西,只是实现一些新方法来更快地更改我的应用程序中的颜色。



这些问题在我的所有仿真器和设备中都保持不变我关闭手机,手动杀死应用程序或卸载/重新安装该应用程序。一个简单的ctrl + z没有工作。澄清 - 所有我想要的是回到有一个启动器图标正常启动我的应用程序(根本没有什么特别的)。



更新:



现在,我立即从两个图标启动时立刻向他们展示。我确实在我的清单中的两个活动中找到代码,显示和更改从.LAUNCHER到.DEFAULT的第二行修复了我原来的问题。然而,我现在总是接近立即接近...在我原来的启动器活动中现在有问题(我可以看到)...我有很多麻烦试图解决这个问题(不知道该怎么办do),开始变得非常担心!



更新2:



我发现我的问题,我感谢你们的帮助!我实际上有两个不同的和不相关的问题发生在同一时间。我的发射器中的第一 - 两个图标是因为我有两个活动,一个

解决方案

两个活动有

 < intent-filter> 
< action android:name =android.intent.action.MAIN/>
< category android:name =android.intent.category.LAUNCHER/>
< / intent-filter>

删除第二个


I am having a very confusing problem with an application I have been working on for some time. Suddenly, when running my application, I found an immediate force close upon launch.

Upon further investigation, I found two launcher icons in my launcher. One of which will either resume the application if it is running or force close if it is not running. The second will behave as normal - launches the application normally and resumes normally.

I am very confused, as I was not doing anything (that I can think of) to cause this problem. I was not changing anything whatsoever in the manifest and just implementing a few new methods to change colors in my app faster.

These problems persist identically in all my emulators and devices whether I turn off the phone, manually kill the app or uninstall/reinstall the app. A simple ctrl+z did not work. To clarify - all I would like is to go back to have one launcher icon to launch my application normally (nothing special goes on at all).

Update:

I am now presented with an immediate force close on launching from either icon. I did find code within two activities within my Manifest displaying and changing the second line from .LAUNCHER to .DEFAULT did fix my original problem. However, I am now always presented with an immediate force close...there are now problems (that I can see) within my originally launcher activity...I am having a lot of trouble attempting to fix this (have no idea what to do) and am starting to become VERY worried!

Update 2:

I found my problems and I thank you guys for all your help! I actually had two separate and unrelated problems that occurred at the same time. Number one - two icons in my launcher: caused because I had two activities with a

解决方案

two activities have

 <intent-filter>
     <action android:name="android.intent.action.MAIN" />
     <category android:name="android.intent.category.LAUNCHER" />
 </intent-filter>

remove second one

这篇关于Android应用程序创建两个启动器图标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆