我有这个编译错误:
绑定不匹配:类型
TabNotasFragment
不是有效替代 对于该类型的有界参数<T extends Fragment>
MainActivity.TabListener<T>
以下是相关的代码:
public class TabNotasFragment extends Fragment {
......
}
.......
Tab tab = mActionBar.newTab()
.setText(R.string.TabNotas)
.setTabListener(new TabListener<TabNotasFragment>(
this, "notas", TabNotasFragment.class));
........
public static class TabListener<T extends Fragment> implements ActionBar.TabListener {
private Fragment mFragment;
private final Activity mActivity;
private final String mTag;
private final Class<T> mClass;
public TabListener(Activity activity, String tag, Class<T> clz) {
mActivity = activity;
mTag = tag;
mClass = clz;
}
......
}
有什么想法吗?