question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

App crash On categoryDetail activity when click on image after orientation change

See original GitHub issue

Summary:

App crash On categoryDetail activity when click on image after orientation change

Steps to reproduce:

  1. Open categoryDetail activity
  2. change the orientation
  3. 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:

https://user-images.githubusercontent.com/65972015/116501158-bf872800-a8cd-11eb-83b6-0043f2b41569.mp4

Would you like to work on the issue? YES.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
madhurgupta10commented, May 3, 2021

@Pratham2305 Sure, feel free to make a PR for it!

1reaction
Prince-kushwahacommented, May 2, 2021

@nicolas-raoul I am not able to solve this issue assign to someone other

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found