简体   繁体   English

从主屏幕,应用程序抽屉或Play商店确定应用程序的启动位置

[英]Determine where app was started from e.g. Home Screen, App Drawer, or Play Store

Is there a way to determine whether an Android app (main activity) was started by tapping its icon on the Home Screen, or from other places (such as the App Drawer, or even the Open button in the Google Play Store app)? 是否可以通过在主屏幕上点击图标或从其他位置(例如App Drawer甚至Google Play Store应用程序中的“打开”按钮)来确定Android应用程序(主要活动)是否已启动?

I need do do this in Java code, preferably in a method such as OnCreate. 我需要用Java代码执行此操作,最好使用OnCreate之类的方法。

For android apps, once it's started, it always run until manually closed. 对于android应用,一旦启动,它将一直运行直到手动关闭。 You can press the history button to see whether the app that you are interested is there. 您可以按历史记录按钮查看您感兴趣的应用程序是否在那里。 If it is, it means that it's running in the background. 如果是,则表示它在后台运行。

I don't think there's a way to tell whether the app is running from Home Screen ... etc. 我认为没有办法判断应用程序是否正在从主屏幕运行...等。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 当应用程序首先从 Play Store 应用程序启动然后从主屏幕启动时,OnCreate 被称为乘法 - OnCreate is called multiply when app is started from Play Store App first and then from home screen 用户能否在 Play 商店中更新应用程序(已从不同的应用程序下载,例如 Mi Store)(反之亦然)? - Will users be able to update app (which has been downloaded from different app, e.g. Mi Store) in Play Store (or vice verse)? 是否有可能知道Android应用程序的来源(例如Google Play)? - Is it possible to know the source(e.g. Google Play) of Android app? 从 google play 安装的应用程序无处显示(主屏幕、抽屉和小部件) - An app installed from google play does not show nowhere (Home Screen, Drawer, and Widgets) 确定是否从主屏幕启动了应用程序? - Determine if app was launched from home screen? Flutter - 从平台特定文件夹播放声音文件(例如,Android/app/src/main/res/raw for Android) - Flutter - Play sound files from platform specific folders (e.g. android/app/src/main/res/raw for Android) 如何为Android应用创建标题屏幕? 例如,当应用程序像Facebook一样加载时 - How do you create a title screen for an android app? E.g. When the app is loading like Facebook Android 应用程序未在主屏幕上创建快捷方式图标(从 Play 商店下载) - Android app not creating shortcut icon on home screen (downloaded from play store) 在项目“应用程序”中,已解决的 Google Play 服务库依赖项依赖于另一个确切版本(例如“[16.0 - In project 'app' a resolved Google Play services library dependency depends on another at an exact version (e.g. "[16.0 通过content:// URI从第三方应用(例如WhatsApp)到我的应用获取视频路径 - Getting Video path from third party app (e.g. WhatsApp) to my app via content:// URI
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM