App crash On categoryDetail activity when click on image after orientation change
See original GitHub issueSummary:
App crash On categoryDetail activity when click on image after orientation change
Steps to reproduce:
- Open categoryDetail activity
- change the orientation
- click on the image
System logs:
2021-04-29 09:06:54.580 31940-31940/fr.free.nrw.commons E/ACRA: ACRA caught a UninitializedPropertyAccessException for fr.free.nrw.commons
kotlin.UninitializedPropertyAccessException: lateinit property categoryImagesCallback has not been initialized
at fr.free.nrw.commons.explore.media.PageableMediaFragment.getCategoryImagesCallback(PageableMediaFragment.kt:24)
at fr.free.nrw.commons.explore.media.PageableMediaFragment$pagedListAdapter$2.invoke(PageableMediaFragment.kt:17)
at fr.free.nrw.commons.explore.media.PageableMediaFragment$pagedListAdapter$2.invoke(PageableMediaFragment.kt:14)
at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74)
at fr.free.nrw.commons.explore.media.PageableMediaFragment.getPagedListAdapter(PageableMediaFragment.kt)
at fr.free.nrw.commons.explore.media.PageableMediaFragment.getTotalMediaCount(PageableMediaFragment.kt:55)
at fr.free.nrw.commons.category.CategoryDetailsActivity.getTotalMediaCount(CategoryDetailsActivity.java:160)
at fr.free.nrw.commons.media.MediaDetailPagerFragment$MediaDetailAdapter.getCount(MediaDetailPagerFragment.java:438)
at androidx.viewpager.widget.ViewPager.setAdapter(ViewPager.java:532)
at fr.free.nrw.commons.media.MediaDetailPagerFragment.onCreateView(MediaDetailPagerFragment.java:109)
at androidx.fragment.app.Fragment.performCreateView(Fragment.java:2698)
at androidx.fragment.app.FragmentStateManager.createView(FragmentStateManager.java:310)
at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1185)
at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1354)
at androidx.fragment.app.FragmentManager.moveFragmentToExpectedState(FragmentManager.java:1432)
at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1495)
at androidx.fragment.app.BackStackRecord.executeOps(BackStackRecord.java:447)
at androidx.fragment.app.FragmentManager.executeOps(FragmentManager.java:2167)
at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:1990)
at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:1945)
at androidx.fragment.app.FragmentManager.execPendingActions(FragmentManager.java:1847)
at androidx.fragment.app.FragmentManager.executePendingTransactions(FragmentManager.java:489)
at fr.free.nrw.commons.category.CategoryDetailsActivity.onMediaClicked(CategoryDetailsActivity.java:125)
at fr.free.nrw.commons.explore.media.PageableMediaFragment$pagedListAdapter$2$1.invoke(PageableMediaFragment.kt:17)
at fr.free.nrw.commons.explore.media.PageableMediaFragment$pagedListAdapter$2$1.invoke(PageableMediaFragment.kt:14)
at fr.free.nrw.commons.explore.media.SearchImagesViewHolder$bind$1.onClick(PagedMediaAdapter.kt:37)
at android.view.View.performClick(View.java:5647)
at android.view.View$PerformClick.run(View.java:22465)
at android.os.Handler.handleCallback(Handler.java:754)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:163)
at android.app.ActivityThread.main(ActivityThread.java:6238)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:933)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:823)
Device and Android version: Android Device :Redmi y3 API : Commons app version: Latest master Screen-shots:
Would you like to work on the issue? YES.
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (5 by maintainers)
Top Results From Across the Web
Android activity keeps crashing on orientation change
Under certain conditions, when I transition the activity from landscape to portrait, or vice-versa, the app crashes. What is particularly ...
Read more >app crash when screen orientation changes???
recently i just develop android app using phonegap and jquery mobile.. After I changes the orientaion of the enumerator, the app crash.
Read more >How to fix lost Activity State Upon Rotation Device - YouTube
Lost Activity State Upon Rotation - for a beginnersIn this video, we will talk how to fix some potentially nasty state issues that...
Read more >Avoiding Android App Crashes Caused by Device Orientation ...
This crashing usually occurs because device orientation changes cause the Android framework to tear down the displayed Activity along within ...
Read more >iOS 16 unexpected rotation behaviour - Apple Developer
While on iOS 15 or earlier, the app remains at Landscape and only rotates to Portrait when physical device's orientation changes.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@Pratham2305 Sure, feel free to make a PR for it!
@nicolas-raoul I am not able to solve this issue assign to someone other