按“返回”按钮时避免闪屏活动 [英] Avoid splash screen activity when pressing Back button

查看:128
本文介绍了按“返回”按钮时避免闪屏活动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的申请中,我有两项活动。首先是启动画面,它只显示应用程序名称和其他一些信息。点击启动画面活动后,我正在加载主要活动。我的应用程序工作正常,但我面临一个小问题。如果我按下主要活动的后退按钮,控制将进入闪屏活动。但是我不想再次显示启动画面活动,我想在按下返回按钮时避免启动画面活动。

In my application, I've two activities. First is a splash screen, which simply shows the application name and few other info. Upon clicking on the splash screen activity, I'm loading the main activity. My app works fine, but I'm facing a small issue. If I press back button from my main activity, control is going to splash screen activity. But I don't want to show the splash screen activity again, I want to avoid splash screen activity when pressing Back button.

有可能吗?如果是这样?

Is it possible? If so how?

推荐答案

AndroidManifest.xml 文件中,添加启动画面中 android:noHistory =true属性< activity>

In your AndroidManifest.xml file, add android:noHistory="true" attribute in your splash screen <activity>.

这篇关于按“返回”按钮时避免闪屏活动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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