我的应用程序在返回START_STICKY后立即崩溃。我的应用程序崩溃没有日志猫异常或任何错误信息?
我有一个前台服务我的应用程序:
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
}
}
我试着调试调试的只剩下最后一点返回START_STICKY;特别是STOPFOREGROUND_ACTION信号之后,它会崩溃。
没有错误,应用程序日志中显示的警告找不到可能出错的地方。
我能做些什么来解决这个问题呢是我停止前台服务的方式是错误的,我还能做些什么来获得更多的应用程序特定日志。
我检查我的代码到处都是,我捕捉异常,并如下记录他们:
try {
// Code expected to throw error or exception
} catch (Exception e) {
Log.e(TAG, Log.getStackTraceString(e));
}
在我绕过例外,他们被缓存并记录处处应用的地方。
一些我看的时候关闭所有过滤器并选择在日志猫详细选项的错误:
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}