Sunday 15 May 2011

android - Getting "SecurityException: Permission Denial" even though permission has been added -


I have recently released a widget that reads data from the content provider. It seemed to work fine in testing, but I have received many crash reports related to permissions for the content provider.

This is the error report I received from the crash report:

  java.lang.SecurityException: Permission denied: reading com.anydo.providers.TasksContentProviderUuri Content: // Com.anydo.provider / tasks to pid = 24036, uid = 10142 com.anydo.provider is required. the permission. READ_ANYDO_TASKS, or grantUriPermission ()   

and the different questions I can see can be related to the manifest file, so here it is:

  & Lt; Use-sdk android: minSdkVersion = "16" Android: targetSdkVersion = "17" /> & Lt; Usage-permission Android: name = "com.anydo.provider.permission.READ_ANYDO_TASKS" /> & Lt; Android: Android: icon = "true_android": icon = & Lt; Receiver Android: name = "AnydoWidgetProvider" & gt; & Lt; Intent-Filter & gt; & Lt; Action Android: name = "android.appwidget.action.APPWIDGET_UPDATE" /> & Lt; / Intent-Filter & gt; & Lt; Meta-Data Android: name = "android.appwidget.provider" Android: resource = "@ xml / anydo_widget_provider" /> & Lt; / Receiver & gt; & Lt; Activity Android: name = "com.gongchangstudio.minimalanydowidget.WidgetSettings" android: label = "@ string / app_name" & gt; & Lt; Intent-Filter & gt; & Lt; Action Android: name = "android.appwidget.action.APPWIDGET_CONFIGURE" /> & Lt; / Intent-Filter & gt; & Lt; / Activity & gt; & Lt; Service android: name = "com.gongchangstudio.minimalanydowidget.TaskWidgetService" Android: permission = "android.permission.BIND_REMOTEVIEWS" Android: export = "false" /> & Lt; / Application & gt;   

Any ideas?

found elsewhere on the stack overflow -

I think it Some had to do something with the permission to run on the same thread, because the following code was added to resolve the problem in onDataSetChanged ().

  thread thread = new thread () {public zero run () {query (); }}; Thread.start (); Try {thread.join () (); } Grip (Interrupted e) e} {}    

No comments:

Post a Comment