因为我一直在使用我的代码,所以我使用了片段。
为此,我有一个活动通过标签使用片段调用片段:
FluxListFragment FLF = (FluxListFragment) getFragmentManager().findFragmentByTag(FRAG_LIST);
但是从今天开始,getFragmentManager 好像就认不出来了。它说 :
"The method getFragmentManager() is undefined for the type FluxMainActivity"
问题来自构建目标吗?(我放的是安卓3.0)
这是代码:
public Class FluxMainActivity extends Activity {
@override
public void onCreate(Bundle saveInstanceState)
{
super.onCreate();
setContentView(R.layout.main);
FluxListeFragment FLF = (FluxListeFragment)getFragmentManager().findFragmentByTag(FRAG_LISTE);
}
}
该方法应该链接到 FluxListeFragment 而不是 FluxMainActivity !我认为演员阵容不正确。