无法扩展列表片段 - "Call requires API level 11"



我正在尝试扩展ListFragment,但我不断收到上述错误。我将安卓支持库添加到我的项目中。

您的项目/类导入可能错误。您可能从 API 11 扩展了 ListFragment (android.app.ListFragment)并且您应该从兼容类(android.support.v4.app.ListFragment)扩展ListFragment

尝试添加

import android.support.v4.app.Fragment;
import android.support.v4.app.ListFragment;

最新更新