Skip to content Skip to sidebar Skip to footer

My Application Is Shutting Down Itself And Logcat Is Not Showing Any Error Messages

I am using my android phone as emulator and current version of android is marshmallow. When I run an application which is having exceptions, the application in my phone is simply c

Solution 1:

privatevoidhandleUncaughtExceptions(){
    Thread.setDefaultUncaughtExceptionHandler (new Thread.UncaughtExceptionHandler()
    {
        @Override
        publicvoiduncaughtException (Thread thread, Throwable e)
        {
            handleUncaughtException (thread, e);
            Log.e(TAG, "error: " + e.getMessage());
        }
    });
}

try implementing this method in your main activity and calling it in onCreate() of your main activity and see if you can see the crash logs. You can also try and put a breakpoint there and try to reproduce the crash and see what's going on

Solution 2:

Turns out there was nothing wrong with android studio. It was my mobile which was not giving proper reply to android studio's logcat. I used the genymotion emulator and its working fine now.

Post a Comment for "My Application Is Shutting Down Itself And Logcat Is Not Showing Any Error Messages"