8

因为我一直在使用我的代码,所以我使用了片段。

为此,我有一个活动通过标签使用片段调用片段:

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 !我认为演员阵容不正确。

4

1 回答 1

5

问题解决了。

项目目标在 API 11 中,但它包含 2 个库,其中一个在目标 API 8 中。

于 2012-05-16T11:45:13.000 回答