Open varunjain0888 opened 4 years ago
I think it is caused by the wrong context, that you construct StfalconImageViewer.Builder with
I am facing the same issue:
Fatal Exception: android.content.res.Resources$NotFoundException: Resource ID #0x7f070073 at android.content.res.Resources.getValue(Resources.java:1351) at androidx.appcompat.widget.ResourceManagerInternal.loadDrawableFromDelegates(ResourceManagerInternal.java:252) at androidx.appcompat.widget.ResourceManagerInternal.getDrawable(ResourceManagerInternal.java:139) at androidx.appcompat.widget.ResourceManagerInternal.getDrawable(ResourceManagerInternal.java:132) at androidx.appcompat.content.res.AppCompatResources.getDrawable(AppCompatResources.java:104) at com.myapp.domain.wp.extentions.ContextKt.getDrawableCompat(Context.kt:20) at com.myapp.domain.wp.MainActivity.loadPosterImage(MainActivity.kt:126) at com.myapp.domain.wp.MainActivity.access$loadPosterImage(MainActivity.kt:28) at com.myapp.domain.wp.MainActivity$openViewer$1.invoke(MainActivity.kt:109) at com.myapp.domain.wp.MainActivity$openViewer$1.invoke(MainActivity.kt:28) at com.myapp.domain.wp.MainActivity$sam$com_stfalcon_imageviewer_loader_ImageLoader$0.loadImage(MainActivity.kt) at com.stfalcon.imageviewer.viewer.view.ImageViewerView.open$imageviewer_release(ImageViewerView.kt:193) at com.stfalcon.imageviewer.viewer.dialog.ImageViewerDialog$$special$$inlined$apply$lambda$1.onShow(ImageViewerDialog.kt:50) at android.app.Dialog$ListenersHandler.handleMessage(Dialog.java:1329) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:148) at android.app.ActivityThread.main(ActivityThread.java:5421) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
I calling it from MainActivity and providing Activity context, Is there any solution for the issue. However, I only face in some devices like Brand: LGE Model: Nexus 5X Orientation: Portrait RAM free: 3 GB Disk free: 771.13 MB Version: 6.0.1
@varunjain0888 : Did you get any solution for the problem?
I think it is caused by the wrong context, that you construct StfalconImageViewer.Builder with
I have used an activity context than also get the above error, should I use application context instead?
Can you please help me out to resolve the issue of the resource not found? @troy379 @vzhovnitsky
@hitesh-dhamshaniya
@varunjain0888 Ive found out that the issue was that we had the wrong theme in the context. So I fixed it with force applying theme to the context.
<style name="PhotoGallery" parent="Theme.AppCompat" />
val context: Context? = context context?.theme?.applyStyle(R.style.PhotoGallery, true)
Thank you for your answer and time, I will check and let you know. Thanks.
Describe the bug