如何在定制的Android主屏幕中添加默认Widget?
我使用Launcher2主屏幕
作为定制主屏幕的基础。 我想使用默认的小部件自定义 Android 主屏幕。
但是当我使用这个示例时,我收到此错误:
09-28 12:03:13.052: ERROR/Launcher.LauncherProvider(9187): Problem allocating appWidgetId
09-28 12:03:13.052: ERROR/Launcher.LauncherProvider(9187): java.lang.SecurityException: bindGagetId appWidgetId=68 provider=ComponentInfo{com.android.protips/com.android.protips.ProtipWidget}: User 10081 does not have android.permission.BIND_APPWIDGET.
09-28 12:03:13.052: ERROR/Launcher.LauncherProvider(9187): at android.os.Parcel.readException(Parcel.java:1322)
09-28 12:03:13.052: ERROR/Launcher.LauncherProvider(9187): at android.os.Parcel.readException(Parcel.java:1276)
09-28 12:03:13.052: ERROR/Launcher.LauncherProvider(9187): at com.android.internal.appwidget.IAppWidgetService$Stub$Proxy.bindAppWidgetId(IAppWidgetService.java:470)
09-28 12:03:13.052: ERROR/Launcher.LauncherProvider(9187): at android.appwidget.AppWidgetManager.bindAppWidgetId(AppWidgetManager.java:337)
09-28 12:03:13.052: ERROR/Launcher.LauncherProvider(9187): at com.android.launcher2.LauncherProvider$DatabaseHelper.addAppWidget(LauncherProvider.java:812)
09-28 12:03:13.052: ERROR/Launcher.LauncherProvider(9187): at com.android.launcher2.LauncherProvider$DatabaseHelper.addAppWidget(LauncherProvider.java:790)
09-28 12:03:13.052: ERROR/Launcher.LauncherProvider(9187): at com.android.launcher2.LauncherProvider$DatabaseHelper.loadFavorites(LauncherProvider.java:670)
09-28 12:03:13.052: ERROR/Launcher.LauncherProvider(9187): at com.android.launcher2.LauncherProvider$DatabaseHelper.onCreate(LauncherProvider.java:239)
09-28 12:03:13.052: ERROR/Launcher.LauncherProvider(9187): at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:126)
09-28 12:03:13.052: ERROR/Launcher.LauncherProvider(9187): at com.android.launcher2.LauncherProvider.query(LauncherProvider.java:108)
09-28 12:03:13.052: ERROR/Launcher.LauncherProvider(9187): at android.content.ContentProvider$Transport.query(ContentProvider.java:187)
09-28 12:03:13.052: ERROR/Launcher.LauncherProvider(9187): at android.content.ContentResolver.query(ContentResolver.java:271)
09-28 12:03:13.052: ERROR/Launcher.LauncherProvider(9187): at com.android.launcher2.LauncherModel$Loader$LoaderThread.loadWorkspace(LauncherModel.java:711)
09-28 12:03:13.052: ERROR/Launcher.LauncherProvider(9187): at com.android.launcher2.LauncherModel$Loader$LoaderThread.loadAndBindWorkspace(LauncherModel.java:521)
09-28 12:03:13.052: ERROR/Launcher.LauncherProvider(9187): at com.android.launcher2.LauncherModel$Loader$LoaderThread.run(LauncherModel.java:588)
我已经在清单中添加了 android.permission.BIND_APPWIDGET
,但它仍然无法正常工作,并且我的默认小部件仍然丢失。
有谁知道可能是什么问题吗?
I use Launcher2 home screen
as the basis for customised the home screen.
I wanted to customized Android Home Screen with default Widget.
But when I use this example, I get this error:
09-28 12:03:13.052: ERROR/Launcher.LauncherProvider(9187): Problem allocating appWidgetId
09-28 12:03:13.052: ERROR/Launcher.LauncherProvider(9187): java.lang.SecurityException: bindGagetId appWidgetId=68 provider=ComponentInfo{com.android.protips/com.android.protips.ProtipWidget}: User 10081 does not have android.permission.BIND_APPWIDGET.
09-28 12:03:13.052: ERROR/Launcher.LauncherProvider(9187): at android.os.Parcel.readException(Parcel.java:1322)
09-28 12:03:13.052: ERROR/Launcher.LauncherProvider(9187): at android.os.Parcel.readException(Parcel.java:1276)
09-28 12:03:13.052: ERROR/Launcher.LauncherProvider(9187): at com.android.internal.appwidget.IAppWidgetService$Stub$Proxy.bindAppWidgetId(IAppWidgetService.java:470)
09-28 12:03:13.052: ERROR/Launcher.LauncherProvider(9187): at android.appwidget.AppWidgetManager.bindAppWidgetId(AppWidgetManager.java:337)
09-28 12:03:13.052: ERROR/Launcher.LauncherProvider(9187): at com.android.launcher2.LauncherProvider$DatabaseHelper.addAppWidget(LauncherProvider.java:812)
09-28 12:03:13.052: ERROR/Launcher.LauncherProvider(9187): at com.android.launcher2.LauncherProvider$DatabaseHelper.addAppWidget(LauncherProvider.java:790)
09-28 12:03:13.052: ERROR/Launcher.LauncherProvider(9187): at com.android.launcher2.LauncherProvider$DatabaseHelper.loadFavorites(LauncherProvider.java:670)
09-28 12:03:13.052: ERROR/Launcher.LauncherProvider(9187): at com.android.launcher2.LauncherProvider$DatabaseHelper.onCreate(LauncherProvider.java:239)
09-28 12:03:13.052: ERROR/Launcher.LauncherProvider(9187): at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:126)
09-28 12:03:13.052: ERROR/Launcher.LauncherProvider(9187): at com.android.launcher2.LauncherProvider.query(LauncherProvider.java:108)
09-28 12:03:13.052: ERROR/Launcher.LauncherProvider(9187): at android.content.ContentProvider$Transport.query(ContentProvider.java:187)
09-28 12:03:13.052: ERROR/Launcher.LauncherProvider(9187): at android.content.ContentResolver.query(ContentResolver.java:271)
09-28 12:03:13.052: ERROR/Launcher.LauncherProvider(9187): at com.android.launcher2.LauncherModel$Loader$LoaderThread.loadWorkspace(LauncherModel.java:711)
09-28 12:03:13.052: ERROR/Launcher.LauncherProvider(9187): at com.android.launcher2.LauncherModel$Loader$LoaderThread.loadAndBindWorkspace(LauncherModel.java:521)
09-28 12:03:13.052: ERROR/Launcher.LauncherProvider(9187): at com.android.launcher2.LauncherModel$Loader$LoaderThread.run(LauncherModel.java:588)
I've already added android.permission.BIND_APPWIDGET
in my manifest, but it's still not working and my default widget is still missing.
Does anyone have any idea what could be the problem?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
android.permission.BIND_APPWIDGET 不适用于系统存储之外的应用程序。
如果没有完整的堆栈跟踪,我无法查明错误的确切位置,但这正是我预期导致问题的原因。
android.permission.BIND_APPWIDGET is not available for applications outside of system storage.
Without a full stack trace I cannot pinpoint the exact location of the error but this is what I expect is causing the problem.