android开发:The method getSupportFragmentManager() is undefined for the type
程序员文章站
2022-07-15 13:22:44
...
问题出现情景:
代码如下:
getSupportFragmentManager().beginTransaction().add(R.id.fragment, fragment).hide(fragment).commit();
出现了“The method getSupportFragmentManager() is undefined”错误。
解决方法:
- 需要实例化的activity必须 extends FragmentActivity
- 用getSupportFragmentManager();来替getFragmentManager()
参考资料:
Android 3.0以前版本使用Fragment提示getFragmentManager is undefined
上一篇: The method getServletContext is undefined for the type HttpServletRequest
下一篇: 在插件模式开发中获取portal相关信息
推荐阅读
-
The method getJspApplicationContext(ServletContext) is undefined for the type JspFactory
-
The method setBuiltInZoomControls(boolean) is undefined for the type MapView
-
The method getDispatcherType() is undefined for the type HttpServletRequest
-
The method getJspApplicationContext(ServletContext) is undefined for the type Js
-
The method getJspApplicationContext(ServletContext) is undefined for the type
-
The method getServletContext is undefined for the type HttpServletRequest
-
android开发:The method getSupportFragmentManager() is undefined for the type
-
The method getJspApplicationContext(ServletContext) is undefined for the type Js
-
The method getJspApplicationContext(ServletContext) is undefined for the type Js
-
Android开发:getSupportFragmentManager()不可用