new RuntimeException("here").fillInStackTrace());
Slog.e("settings", " setOnCheckedChangeListener",new RuntimeException("here").fillInStackTrace());
ActivityManagerService.java
@Override
public void moveTaskToStack(int taskId, int stackId, boolean toTop) {
enforceCallingPermission(android.Manifest.permission.MANAGE_ACTIVITY_STACKS,
"moveTaskToStack()");
if (stackId == HOME_STACK_ID) {
Slog.e(TAG, "moveTaskToStack: Attempt to move task " + taskId + " to home stack",
new RuntimeException("here").fillInStackTrace());
}
synchronized (this) {
long ident = Binder.clearCallingIdentity();
try {
if (DEBUG_STACK) Slog.d(TAG, "moveTaskToStack: moving task=" + taskId + " to stackId="
+ stackId + " toTop=" + toTop);
mStackSupervisor.moveTaskToStack(taskId, stackId, toTop);
} finally {
Binder.restoreCallingIdentity(ident);
}
}
}
可已输出程序调用的堆栈信息及调用的地方,方便调试。
StackTraceElement st[]= Thread.currentThread().getStackTrace();
for(int i=0;i<st.length;i++)
Log.d(TAG,i+":"+st[i]);
for(int i=0;i<st.length;i++)
Log.d(TAG,i+":"+st[i]);