单项选择题

fragment实例化的三种方式的描述,不正确的是()

A.直接new…Fragment()
B.findFragmentById(int id)
C.findFragmentByTag(String tag)
D.getFragments(String tag)

<上一题 目录 下一题>
热门 试题

单项选择题
当Fragment与宿主Activity解绑时需调用的生命周期方法是()

A.onAttach()
B.onDetach()
C.onCreateView()
D.onActivityCreated()

单项选择题
关于fragment在activity的XML文件中添加的使用,说法正确的是()

A.使用标签<包名+自定义fragment的类名/>
B.需要在manifest里注册自定义的fragment
C.属性中需要定义android:fragment="xxx"
D.使用<fragment/>标签来添加

相关试题
  • ViewModel的数据会在Android系统销毁并重新...
  • 在Android Studio中,可以通过Tools菜单下...
  • 在ItemDetailsViewModel中,uiState的作用...
  • 在HomeScreen中,homeUiState的作用是什么...
  • 在HomeViewModel中,TIMEOUT_MILLIS的作用...