android - 如何在 Android 5.0 的锁屏或主屏幕上显示小部件/自定义布局

标签 android android-5.0-lollipop android-appwidget lockscreen homescreen

我想在主屏幕或锁屏上显示我的自定义布局,但我在 Android 5.0 (Lollipop) 中找不到任何可用的示例。

正如@commonsware 所建议的那样,这在 5.0 上是不可能的但是这如何 Next Lock Screen app在 5.0 上管理这个

我想实现类似 this app 的目标, 任何方向或帮助将不胜感激。

谢谢!

最佳答案

Android 5.0 摆脱了锁屏上的应用程序小部件,因此不再支持此功能。引用 the documentation :

The widgetCategory attribute declares whether your App Widget can be displayed on the home screen (home_screen), the lock screen (keyguard), or both. Only Android versions lower than 5.0 support lock-screen widgets. For Android 5.0 and higher, only home_screen is valid.

关于android - 如何在 Android 5.0 的锁屏或主屏幕上显示小部件/自定义布局,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32526078/

相关文章:

android - Android数据库同步

来自 url 的 html 的 Android textview

android - Material Design 透明 ActionBar

android - ImageButton 上的 VectorDrawable 很难看

安卓 Lollipop : Launcher crashes when adding app widget to Home Screen

java - 为什么我的 Android 选项卡不能正常工作?

android - Android 5.0 上的小而宽 View 的阴影看起来很奇怪,但在 5.1 上却不是

android - Android App Widgets 是运行在应用进程还是宿主进程?

椭圆大小的 Android AppWidget 布局问题

android - 通话过程中耳机输出的音频流能否被截取?