Android App活动已安装为多个图标 [英] Android App activities installed as multiple icons

查看:95
本文介绍了Android App活动已安装为多个图标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的Android应用有2个活动.登录屏幕和搜索屏幕.当我在模拟器或设备上部署该应用程序时,我看到同一应用程序有2个图标.当我单击图标1时,它会打开屏幕1(登录屏幕),而当我单击图标2时,它会打开屏幕2(搜索屏幕).按照逻辑,当我登录时,它应该显示搜索屏幕.不知道何时犯错.

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 opens screen 1 (login screen) and When I click on icon 2 it opens screen 2 (search screen). By logic when I login it should show the search screen. Not sure when I'm making the mistake.

推荐答案

您的清单文件在您要具有图标的活动中应仅包含以下行:

Your manifest file should only have this line in the activity you want to have an icon:

<category android:name="android.intent.category.MAIN" />

根据您的描述,听起来两个活动都具有这一行.

Based on your description, it sounds like both activities have this line.

这篇关于Android App活动已安装为多个图标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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