gpt4 book ai didi

android - ActionbarSherlock 混淆了 Fragment 的 onAttach() 方法?

转载 作者:行者123 更新时间:2023-11-30 04:21:25 24 4
gpt4 key购买 nike

Fragments 之后是否有其他人在覆盖 onAttach() 时遇到问题从 android-support-v4.jar 切换到 ActionBarSherlock图书馆?e, g.

@ Override 
public void onAttach (Activity activity) {

super. onAttach (activity);
}

对于 ActionBarSherlock ,编译器会报错:

The method onAttach (Activity) of type ... Fragment must override or 
Implement a super-type method

但是对于 android-support-v4.jar 文件,它工作正常。

*******更新 em>*****

我也尝试过使用:

@Override
onAttach(FragmentActivity activity){
super.onAttach(activity);
...
}

它基本上提示同样的事情:

The method onAttach (FragmentActivity) of type ... must override or 
Implement a super-type method

最佳答案

确保将 Java 编译器合规级别设置为 1.6属性->"Java Compiler"->"Compiler compliance level"

您需要安装 JRE1.6 或 JRE1.7。

关于android - ActionbarSherlock 混淆了 Fragment 的 onAttach() 方法?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9212372/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com