在我的应用程序中,我让用户从图库中选择图像,并且在 4.2 之前执行此操作没有问题,但是现在当我选择从我的 google+ 帐户同步的图像时,我猜是 Picasa 图像我收到此错误
11-25 20:31:52.508: E/AndroidRuntime(17387): java.lang.RuntimeException: An error occured while executing doInBackground()
11-25 20:31:52.508: E/AndroidRuntime(17387): at android.os.AsyncTask$3.done(AsyncTask.java:299)
11-25 20:31:52.508: E/AndroidRuntime(17387): at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:352)
11-25 20:31:52.508: E/AndroidRuntime(17387): at java.util.concurrent.FutureTask.setException(FutureTask.java:219)
11-25 20:31:52.508: E/AndroidRuntime(17387): at java.util.concurrent.FutureTask.run(FutureTask.java:239)
11-25 20:31:52.508: E/AndroidRuntime(17387): at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:230)
11-25 20:31:52.508: E/AndroidRuntime(17387): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
11-25 20:31:52.508: E/AndroidRuntime(17387): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
11-25 20:31:52.508: E/AndroidRuntime(17387): at java.lang.Thread.run(Thread.java:856)
11-25 20:31:52.508: E/AndroidRuntime(17387): Caused by: java.lang.SecurityException: Permission Denial: opening provider com.android.gallery3d.provider.GalleryProvider from ProcessRecord{42817d60 17387:com.tyczj.bowling/u0a10087} (pid=17387, uid=10087) requires com.google.android.gallery3d.permission.GALLERY_PROVIDER or com.google.android.gallery3d.permission.GALLERY_PROVIDER
11-25 20:31:52.508: E/AndroidRuntime(17387): at android.os.Parcel.readException(Parcel.java:1425)
11-25 20:31:52.508: E/AndroidRuntime(17387): at android.os.Parcel.readException(Parcel.java:1379)
11-25 20:31:52.508: E/AndroidRuntime(17387): at android.app.ActivityManagerProxy.getContentProvider(ActivityManagerNative.java:2530)
11-25 20:31:52.508: E/AndroidRuntime(17387): at android.app.ActivityThread.acquireProvider(ActivityThread.java:4460)
11-25 20:31:52.508: E/AndroidRuntime(17387): at android.app.ContextImpl$ApplicationContentResolver.acquireUnstableProvider(ContextImpl.java:2002)
11-25 20:31:52.508: E/AndroidRuntime(17387): at android.content.ContentResolver.acquireUnstableProvider(ContentResolver.java:1101)
11-25 20:31:52.508: E/AndroidRuntime(17387): at android.content.ContentResolver.openTypedAssetFileDescriptor(ContentResolver.java:708)
11-25 20:31:52.508: E/AndroidRuntime(17387): at android.content.ContentResolver.openAssetFileDescriptor(ContentResolver.java:614)
11-25 20:31:52.508: E/AndroidRuntime(17387): at android.content.ContentResolver.openInputStream(ContentResolver.java:449)
11-25 20:31:52.508: E/AndroidRuntime(17387): at com.tyczj.bowling.BowlersListFragment$LoadImage.doInBackground(BowlersListFragment.java:390)
11-25 20:31:52.508: E/AndroidRuntime(17387): at com.tyczj.bowling.BowlersListFragment$LoadImage.doInBackground(BowlersListFragment.java:1)
11-25 20:31:52.508: E/AndroidRuntime(17387): at android.os.AsyncTask$2.call(AsyncTask.java:287)
11-25 20:31:52.508: E/AndroidRuntime(17387): at java.util.concurrent.FutureTask.run(FutureTask.java:234)
11-25 20:31:52.508: E/AndroidRuntime(17387): ... 4 more
所以我输入com.google.android.gallery3d.permission.GALLERY_PROVIDER
了我的清单,但我仍然得到那个错误,那么我还需要做什么呢?这是我第一次看到这个并且在网上没有找到关于这个问题的信息。
如果这将是一个问题,我可以让画廊显示设备上的图像和exclude Picasa
图像吗?
就像我说的那样,我以前没有遇到过这个问题,4.2
或者可能与recent google+ update?
编辑:
它只会在我退出应用程序并尝试重新启动后给我错误。因此,如果我在应用程序中并选择图像以显示第一次它可以正常工作,直到我退出。我将它存储Uri
在我的数据库中以在它启动时加载
这是我的清单权限
<uses-permission android:name="com.tyczj.bowling.permission.C2D_MESSAGE" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.USE_CREDENTIALS" />
<uses-permission android:name="com.google.android.gallery3d.permission.GALLERY_PROVIDER" />
<uses-permission android:name="android.permission.INTERNET" />