App Crashing when changing theme when an uploaded image is already viewed
See original GitHub issueSummary:
The application is crashing. If one clicks on an uploaded picture from the home screen then tries to change the theme of the application(dark/light) then returning to the previous activity the application will crash.
Steps to reproduce:
- Upload a picture.
- Go settings by swiping from left to right to open the Navigation Drawer.
- Switch between the themes.
- Press the back button.
System logs:
Add logcat files here (if possible).
2020-01-28 06:25:37.837 20244-20244/fr.free.nrw.commons.beta E/AndroidRuntime: FATAL EXCEPTION: main
Process: fr.free.nrw.commons.beta, PID: 20244
java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.ProgressBar.setVisibility(int)' on a null object reference
at fr.free.nrw.commons.contributions.ContributionsListFragment.showProgress(ContributionsListFragment.java:174)
at fr.free.nrw.commons.contributions.ContributionsFragment.showProgress(ContributionsFragment.java:567)
at fr.free.nrw.commons.contributions.ContributionsPresenter.onLoadFinished(ContributionsPresenter.java:76)
at fr.free.nrw.commons.contributions.ContributionsPresenter.onLoadFinished(ContributionsPresenter.java:26)
at androidx.loader.app.LoaderManagerImpl$LoaderObserver.onChanged(LoaderManagerImpl.java:250)
at androidx.lifecycle.LiveData.considerNotify(LiveData.java:113)
at androidx.lifecycle.LiveData.dispatchingValue(LiveData.java:131)
at androidx.lifecycle.LiveData.setValue(LiveData.java:289)
at androidx.lifecycle.MutableLiveData.setValue(MutableLiveData.java:33)
at androidx.loader.app.LoaderManagerImpl$LoaderInfo.setValue(LoaderManagerImpl.java:189)
at androidx.loader.app.LoaderManagerImpl$LoaderInfo.onLoadComplete(LoaderManagerImpl.java:174)
at androidx.loader.content.Loader.deliverResult(Loader.java:132)
at androidx.loader.content.CursorLoader.deliverResult(CursorLoader.java:109)
at androidx.loader.content.CursorLoader.onStartLoading(CursorLoader.java:155)
at androidx.loader.content.Loader.startLoading(Loader.java:285)
at androidx.loader.app.LoaderManagerImpl$LoaderInfo.onActive(LoaderManagerImpl.java:77)
at androidx.lifecycle.LiveData$ObserverWrapper.activeStateChanged(LiveData.java:418)
at androidx.lifecycle.LiveData$LifecycleBoundObserver.onStateChanged(LiveData.java:376)
at androidx.lifecycle.LifecycleRegistry$ObserverWithState.dispatchEvent(LifecycleRegistry.java:355)
at androidx.lifecycle.LifecycleRegistry.forwardPass(LifecycleRegistry.java:293)
at androidx.lifecycle.LifecycleRegistry.sync(LifecycleRegistry.java:333)
at androidx.lifecycle.LifecycleRegistry.moveToState(LifecycleRegistry.java:138)
at androidx.lifecycle.LifecycleRegistry.handleLifecycleEvent(LifecycleRegistry.java:124)
at androidx.lifecycle.ReportFragment.dispatch(ReportFragment.java:122)
at androidx.lifecycle.ReportFragment.onStart(ReportFragment.java:82)
at android.app.Fragment.performStart(Fragment.java:2548)
at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1334)
at android.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManager.java:1581)
at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1642)
at android.app.FragmentManagerImpl.dispatchMoveToState(FragmentManager.java:3051)
at android.app.FragmentManagerImpl.dispatchStart(FragmentManager.java:3008)
at android.app.FragmentController.dispatchStart(FragmentController.java:193)
at android.app.Activity.performStart(Activity.java:7264)
at android.app.ActivityThread.handleStartActivity(ActivityThread.java:2970)
at android.app.servertransaction.TransactionExecutor.performLifecycleSequence(TransactionExecutor.java:180)
at android.app.servertransaction.TransactionExecutor.cycleToPath(TransactionExecutor.java:165)
at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:142)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:70)
at android.app.ClientTransactionHandler.executeTransaction(ClientTransactionHandler.java:55)
at android.app.ActivityThread.handleRelaunchActivityLocally(ActivityThread.java:4806)
at android.app.ActivityThread.access$3300(ActivityThread.java:200)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1841)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:201)
at android.app.ActivityThread.main(ActivityThread.java:6823)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
2020-01-28 06:25:37.837 20244-20244/fr.free.nrw.commons.beta E/AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:873)
2020-01-28 06:25:37.845 20244-20244/fr.free.nrw.commons.beta E/ACRA: ACRA caught a NullPointerException for fr.free.nrw.commons.beta
java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.ProgressBar.setVisibility(int)' on a null object reference
at fr.free.nrw.commons.contributions.ContributionsListFragment.showProgress(ContributionsListFragment.java:174)
at fr.free.nrw.commons.contributions.ContributionsFragment.showProgress(ContributionsFragment.java:567)
at fr.free.nrw.commons.contributions.ContributionsPresenter.onLoadFinished(ContributionsPresenter.java:76)
at fr.free.nrw.commons.contributions.ContributionsPresenter.onLoadFinished(ContributionsPresenter.java:26)
at androidx.loader.app.LoaderManagerImpl$LoaderObserver.onChanged(LoaderManagerImpl.java:250)
at androidx.lifecycle.LiveData.considerNotify(LiveData.java:113)
at androidx.lifecycle.LiveData.dispatchingValue(LiveData.java:131)
at androidx.lifecycle.LiveData.setValue(LiveData.java:289)
at androidx.lifecycle.MutableLiveData.setValue(MutableLiveData.java:33)
at androidx.loader.app.LoaderManagerImpl$LoaderInfo.setValue(LoaderManagerImpl.java:189)
at androidx.loader.app.LoaderManagerImpl$LoaderInfo.onLoadComplete(LoaderManagerImpl.java:174)
at androidx.loader.content.Loader.deliverResult(Loader.java:132)
at androidx.loader.content.CursorLoader.deliverResult(CursorLoader.java:109)
at androidx.loader.content.CursorLoader.onStartLoading(CursorLoader.java:155)
at androidx.loader.content.Loader.startLoading(Loader.java:285)
at androidx.loader.app.LoaderManagerImpl$LoaderInfo.onActive(LoaderManagerImpl.java:77)
at androidx.lifecycle.LiveData$ObserverWrapper.activeStateChanged(LiveData.java:418)
at androidx.lifecycle.LiveData$LifecycleBoundObserver.onStateChanged(LiveData.java:376)
at androidx.lifecycle.LifecycleRegistry$ObserverWithState.dispatchEvent(LifecycleRegistry.java:355)
at androidx.lifecycle.LifecycleRegistry.forwardPass(LifecycleRegistry.java:293)
at androidx.lifecycle.LifecycleRegistry.sync(LifecycleRegistry.java:333)
at androidx.lifecycle.LifecycleRegistry.moveToState(LifecycleRegistry.java:138)
at androidx.lifecycle.LifecycleRegistry.handleLifecycleEvent(LifecycleRegistry.java:124)
at androidx.lifecycle.ReportFragment.dispatch(ReportFragment.java:122)
at androidx.lifecycle.ReportFragment.onStart(ReportFragment.java:82)
at android.app.Fragment.performStart(Fragment.java:2548)
at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1334)
at android.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManager.java:1581)
at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1642)
at android.app.FragmentManagerImpl.dispatchMoveToState(FragmentManager.java:3051)
at android.app.FragmentManagerImpl.dispatchStart(FragmentManager.java:3008)
at android.app.FragmentController.dispatchStart(FragmentController.java:193)
at android.app.Activity.performStart(Activity.java:7264)
at android.app.ActivityThread.handleStartActivity(ActivityThread.java:2970)
at android.app.servertransaction.TransactionExecutor.performLifecycleSequence(TransactionExecutor.java:180)
at android.app.servertransaction.TransactionExecutor.cycleToPath(TransactionExecutor.java:165)
at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:142)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:70)
at android.app.ClientTransactionHandler.executeTransaction(ClientTransactionHandler.java:55)
at android.app.ActivityThread.handleRelaunchActivityLocally(ActivityThread.java:4806)
at android.app.ActivityThread.access$3300(ActivityThread.java:200)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1841)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:201)
at android.app.ActivityThread.main(ActivityThread.java:6823)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
2020-01-28 06:25:37.846 20244-20244/fr.free.nrw.commons.beta E/ACRA: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:873)
Device and Android version:
Device Model: Redmi Note 7 Pro Version: Android 9 Is it the stock version from the manufacturer or a custom ROM ? Yes
Commons app version:
version: 2.12.2-debug branch: master Screen-shots:
Would you like to work on the issue?
Yes. I would like to work on the issue.
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (6 by maintainers)
Top Results From Across the Web
App is crashing when we upload the image from gallery?
try this: java code: public class MainActivity extends AppCompatActivity implements View.OnClickListener { private static final int ...
Read more >Photos app crashes when attempting to edit
Anyone else having an issue with Photos app crashing often when attempting to edit an image? The app will close itself about 20%...
Read more >Application crashing after trying to edit photo for a second time
It appears to me that on the second attempt to edit, the StartSketch action is not getting a valid image, and if the...
Read more >App Crashes when loading a list of images. #65834 - GitHub
My app crashes after reaching 800mb+ or even 1200mb while loading a simple list of images No stacktrace available.
Read more >[Facebook] App crash once you click a picture or Post ...
What steps would let us observe this issue? 1. Opened Facebook 2. Click post,pictures 3. Loads and sent back to home screen then...
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
@4D17Y4 I think you already have another issue assigned? 😃
Since Animeshk08 has not replied, @gouri-panda can have this one if not already working on any other issue.
@animeshk08 How is your progress? 😃