本文整理了Java中android.support.v4.app.Fragment.initState()
方法的一些代码示例,展示了Fragment.initState()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Fragment.initState()
方法的具体详情如下:
包路径:android.support.v4.app.Fragment
类名称:Fragment
方法名:initState
[英]Called by the fragment manager once this fragment has been removed, so that we don't have any left-over state if the application decides to re-use the instance. This only clears state that the framework internally manages, not things the application sets.
[中]在删除该片段后,由片段管理器调用,这样,如果应用程序决定重用实例,我们就不会有任何剩余状态。这只清除框架内部管理的状态,而不是应用程序设置的内容。
代码示例来源:origin: stackoverflow.com
void makeInactive(Fragment f) {
if (f.mIndex < 0) {
return;
}
if (DEBUG) Log.v(TAG, "Freeing fragment index " + f);
mActive.set(f.mIndex, null);
if (mAvailIndices == null) {
mAvailIndices = new ArrayList<Integer>();
}
mAvailIndices.add(f.mIndex);
mActivity.invalidateFragment(f.mWho);
f.initState();
}
代码示例来源:origin: com.google.android/support-v4
void makeInactive(Fragment f) {
if (f.mIndex < 0) {
return;
}
if (DEBUG) Log.v(TAG, "Freeing fragment index " + f.mIndex);
mActive.set(f.mIndex, null);
if (mAvailIndices == null) {
mAvailIndices = new ArrayList<Integer>();
}
mAvailIndices.add(f.mIndex);
mActivity.invalidateSupportFragmentIndex(f.mIndex);
f.initState();
}
代码示例来源:origin: kingargyle/adt-leanback-support
void makeInactive(Fragment f) {
if (f.mIndex < 0) {
return;
}
if (DEBUG) Log.v(TAG, "Freeing fragment index " + f);
mActive.set(f.mIndex, null);
if (mAvailIndices == null) {
mAvailIndices = new ArrayList<Integer>();
}
mAvailIndices.add(f.mIndex);
mActivity.invalidateSupportFragment(f.mWho);
f.initState();
}
内容来源于网络,如有侵权,请联系作者删除!