简体   繁体   English

当启动Android设备上的任何应用程序时,该怎么做?

[英]How to do some action when any app on Android device is launched?

I want to be able to show "Hello world!" 我希望能够显示“ Hello world!” whenever new application on Android is launched. 每当在Android上启动新应用程序时。

How to do such thing? 怎么做这样的事情?

I know it's possible. 我知道有可能 As example Password protector (http://droidlessons.com/how-to-password-protect-apps-on-android/) shows password screen when another app is launched. 例如,启动另一个应用程序时,密码保护器(http://droidlessons.com/how-to-password-protect-apps-on-android/)显示密码屏幕。

Password protectors either monitor the topmost activity or monitor the logcat output. 密码保护程序要么监视最高级的活动,要么监视logcat的输出。 Neither of these methods tell you when an application is launched, only when the topmost activity changes. 这两种方法都不会告诉您何时启动应用程序,只有当最顶层的活动发生变化时才告诉您。 There isn't any way to properly be told when an activity starts (unless you modify your OS framework for that purpose). 没有任何方法可以正确告知活动何时开始(除非您为此目的修改了OS框架)。

暂无
暂无

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

相关问题 启动我的Android应用程序时如何执行某些操作 - How to perform some action when my Android app is launched 当任何设备中存在多个应用程序以对传入的SMS执行某些操作时,如何处理Android中的情​​况? - How to handle situation in Android when there are more than one app exists in any device to perform some action for any incoming SMS? 当用户在其设备+ Android中打开其他应用程序时,如何从我的应用程序执行某些操作 - How to perform some action from my App when the user opens some other application in his device + Android 我如何知道何时启动和销毁Android应用程序? - How do I know when an Android app is launched and destroyed? 如何检测是否在Android中启动任何本机应用程序 - How to detect if any native app is launched in android 从“使用(短信应用程序)完成操作”屏幕启动应用程序时,如何获取联系人号码和姓名? - How do I get Contact number + name when app is launched from 'complete action using (sms app)' screen? Android NFC:启动了应用程序,但无意采取任何行动 - Android NFC: App launched, but action is not in intent 在物理设备上启动时,Android App卡在启动屏幕上,但在模拟器上运行良好 - Android App gets stuck on splashscreen when launched on physical device but works fine when on an emulator 如何在 Android 中跟踪应用程序使用情况? 如何检测活动何时启动? - How to Track App Usage in Android? How to detect when an activity is launched? 为什么从设备启动我的应用程序时,我的 Android 启动画面没有执行? - Why is my Android splash screen not executing when my app is launched from the device?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM