Since the Android getFragmentManager() API is deprecated, is there any alternative?

前端 未结 12 1557
梦毁少年i
梦毁少年i 2020-12-05 06:47

FragmentManager is deprecated. Is there an alternative or what can I do now?

 PlaceAutocompleteFragment autocompleteFragment = (PlaceAutocomplet         


        
12条回答
  •  一个人的身影
    2020-12-05 07:20

    You should use the Fragment class from Android Support library instead.

    android.app.Fragment was deprecated in API level 28. Use the Support Library Fragment for consistent behavior across all devices and access to Lifecycle.

    Use android.support.v4.app.Fragment instead.

提交回复
热议问题