Java – Android app crashes after cleaning up memory

Android app crashes after cleaning up memory… here is a solution to the problem.

Android app crashes after cleaning up memory

My app seems fine. However, when I try to clean up the native memory on my Galaxy S4 when I open it again, the app seems to get all the errors and crashes with a NullPointerException. The same happens when the application remains open for a long time.

enter image description here

Is there a way to permanently close my app when this happens?

I’ve closed it

db.close();
finish();

Just need to know when

Related Problems and Solutions