[todo-mvp-clean] Crashed when activity is destroyed.
See original GitHub issueI turn on “Don’t keep activities” flag to simulate activity destroyed by system when we leave it.
In SaveTask i put Thread.sleep(2000);
before getUseCaseCallback().onSuccess(new ResponseValue(task));
My step is:
add new task -> save -> press home button to put app to background -> after usecase done callback in presenter mAddTaskView.showTasksList();
and in fragment getActivity().setResult(Activity.RESULT_OK);
will crash because getActivity()
= null
How do I handle this case?
Issue Analytics
- State:
- Created 6 years ago
- Comments:10 (4 by maintainers)
Top Results From Across the Web
Android crash "Activity has been destroyed" - Stack Overflow
I'm facing some crashes in my application with the following stacktrace: Fatal Exception: java.lang.IllegalStateException: Activity has been ...
Read more >Why Do My Apps Keep Crashing on Android? - Avast
Find out why apps freeze and how to stop apps from crashing. Then get a specialized cleanup app to keep your Android phone...
Read more >Don't Keep Activities | by Matt Robertson - ProAndroidDev
With “Don't Keep Activities” enabled, this becomes 100% reproducible, since the Activity is always destroyed as soon as the user leaves the app....
Read more >How to Fix Crashing Apps on an iPhone or Android?
I am a developer of iPhone/Android and my app keeps crashing on users ... Within this window, some brands add a button called...
Read more >Crashing, freezing, or unexpectedly restarting troubleshooting
Crashing, freezing, and restarting are usually signs of a software or app problem. This means your device isn't broken, but probably needs some...
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
google gooogle google
google all product i like