Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/216.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/logging/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 未为SherlockFragment类型定义ActivityCreated(bundle)方法_Android_Actionbarsherlock_Bundle_Undefined - Fatal编程技术网

Android 未为SherlockFragment类型定义ActivityCreated(bundle)方法

Android 未为SherlockFragment类型定义ActivityCreated(bundle)方法,android,actionbarsherlock,bundle,undefined,Android,Actionbarsherlock,Bundle,Undefined,我正在尝试执行一个实现actionBarSherlock的项目,我已将库正确添加到该项目中,但出现以下错误: The method onActivityCreated(bundle) is undefined for the type SherlockFragment 这是项目中的代码: public class A_class extends SherlockFragment implements OnClickListener { ... } 我想答案很简单,但我想不出来。有什么

我正在尝试执行一个实现actionBarSherlock的项目,我已将库正确添加到该项目中,但出现以下错误:

The method onActivityCreated(bundle) is undefined for the type SherlockFragment
这是项目中的代码:

public class A_class extends SherlockFragment implements
    OnClickListener { ... }
我想答案很简单,但我想不出来。有什么想法吗?

有两种方法:

如果要使用具有sherlock功能的片段,请使用
SherlockFragment
。在这种情况下,您不能有与活动相关的方法,因为它是一个“片段”


否则,您正在查找《夏洛克碎片活动》

是的,没关系……但您可以通过单击我答案左侧的右标记来接受答案。很高兴我能帮忙