search

Home  >  Q&A  >  body text

android - 使用Fragment时出现了奇怪的错误

API版本是23

高洛峰高洛峰2772 days ago433

reply all(3)I'll reply

  • PHPz

    PHPz2017-04-17 17:33:13

    Try getSupportFragmentManager()

    reply
    0
  • 阿神

    阿神2017-04-17 17:33:13

    There are two situations when creating a new extends Fragment inherited by a fragment. One is to import the app, in which case getFragmentManager() is used.
    But the default is to inherit v4, this uses getSupportFragmentManager().
    So you change fragment to import app, or change it to getSupportFragmentManager()

    reply
    0
  • 巴扎黑

    巴扎黑2017-04-17 17:33:13

    I agree with what you said above. Which package does Fragment use? Please confirm it

    reply
    0
  • Cancelreply