The method 'getSupportFragmentManager()' is unsupported

后端 未结 1 1186
天命终不由人
天命终不由人 2021-01-17 11:08

So i\'m trying to enable datepicker for android versions bellow 11. for that i\'m using support library v4. I import all the thing necessary:

import android.         


        
1条回答
  •  粉色の甜心
    2021-01-17 11:41

    My guess is that your MainActivity is not extending FragmentActivity! In the SupportPackage an Activity must inherit from FragmentActivity to get Methods like getSupportedFragmentManager().

    EDIT:

    Since your Activity is inheriting from another class, you can try to implement the Behavior of one of these classes and kind of merge them. I.e here you'll find the code for FragmentActivity: FragmentActivity Source

    0 讨论(0)
提交回复
热议问题