My application crashes immediately after return START_STICKY.
I have a foreground service in my application :
public class MyService extends Service {
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
if (intent != null) {
if (intent.getAction().equals(STARTFOREGROUND_ACTION)) {
// Code to create/update notification and start processing goes here
} else if (intent.getAction().equals(ANOTHER_ACTION)) {
// Code to create/update notification and do another processing
} else if (null != intent && intent.getAction().equals(STOPFOREGROUND_ACTION)) {
stopForeground(true);
stopSelf();
}
}
return START_STICKY; // Last reference point in debugger after which application crashes
}
}
I tried debugging only last point of debug is return START_STICKY; specially for STOPFOREGROUND_ACTION signal after which it crashes.
No error, warning is shown in application logs can't figure out what may have gone wrong.
What can I do to solve this is my way of stopping foreground service is wrong, what else I can to do get more app specific logs.
I have checked my code everywhere I am catching exceptions and logging them as below :
try {
// Code expected to throw error or exception
} catch (Exception e) {
Log.e(TAG, Log.getStackTraceString(e));
}
No place in the app where I am bypassing exception they are cached and logged everywhere.
Some of the errors I see when I disable all filters and select verbose option on log cat :
1] `A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0x10 in tid 32152 (Thread-1910)`
2] com.my.test.MyActivity (server)' ~ Consumer closed input channel or an error occurred. events=0x9
3] [Application Error: com.my.test](this:0xb28d3c00,id:809,api:1,p:933,c:252) new GraphicBuffer needed
4] I/WindowState: WIN DEATH: Window{41e99c5 u0 com.my.test.MyActivity}