简体   繁体   English

Android App 可能占据整个屏幕

[英]Possible for an Android App take up whole screen

I am in middle of app development and what I want it that when user powers up his/her phone and the home screen loads, can there be a broadcast (from system) which could fire an app to launch and take up the whole screen?我正在开发应用程序,我想要什么,当用户打开他/她的手机并加载主屏幕时,是否有一个广播(来自系统)可以触发应用程序启动并占据整个屏幕?

Is is possible to do this?有可能做到这一点吗?

Further, can this also be done via some background service, when the app wants, it should display and take full screen of user.此外,这也可以通过一些后台服务来完成,当应用程序需要时,它应该显示并占据用户的全屏。 Can this be done also?这也能做到吗?

What would I need to do for this?我需要为此做些什么?

Up until Android 10, you could register a broadcast for android.intent.action.BOOT_COMPLETED , and then you could start an Activity from there.在 Android 10 之前,您可以为android.intent.action.BOOT_COMPLETED注册广播,然后您可以从那里开始一个活动。

Starting from Andoid 10, there are some restrictions on opening activities from background.从 Andoid 10 开始,后台打开活动有一些限制。 Check the documentation , there are a few exception that might possibly apply to you ( such as having SYSTEM_ALERT_WINDOW ).检查文档,有一些可能适用于您的异常(例如具有SYSTEM_ALERT_WINDOW )。

Note that this kind of behaviour is frowned upon, as it's very intrusive ( some app randomly opening by itself feels like adware app ), so I'd suggest you don't go down this route.请注意,这种行为是不受欢迎的,因为它非常具有侵入性(某些应用程序自行随机打开感觉就像广告软件应用程序),所以我建议您不要走这条路线 go。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM