我已经梳理了GrepCode和下载的源代码,但是我找不到一个FragmentTransaction类implementation.Can --有人向我指出一个源代码吗?
发布于 2015-05-12 12:10:42
这里是可能的实现之一。
类的签名如下所示:
final class BackStackRecord extends FragmentTransaction implements FragmentManager.BackStackEntry, Runnable {...}在grep代码中,您可以单击指向类名旁边的小箭头,以找到派生类。
为了使这个答案完整:
int commitInternal(boolean allowStateLoss) {
if (mCommitted) {
throw new IllegalStateException("commit already called");
}
if (FragmentManagerImpl.DEBUG) {
Log.v(TAG, "Commit: " + this);
LogWriter logw = new LogWriter(Log.VERBOSE, TAG);
PrintWriter pw = new FastPrintWriter(logw, false, 1024);
dump(" ", null, pw, null);
pw.flush();
}
mCommitted = true;
if (mAddToBackStack) {
mIndex = mManager.allocBackStackIndex(this);
} else {
mIndex = -1;
}
mManager.enqueueAction(this, allowStateLoss);
return mIndex;
}commitInternal是由commit调用的
https://stackoverflow.com/questions/30190282
复制相似问题