cannot resolve method add(int , new tFragment()).commit() in android studion 1.0.1

前端 未结 2 1722
慢半拍i
慢半拍i 2021-01-18 18:35

I was working with fragments in android studio 1.0.1. Just as network process are not good to be done in the main UI, i moved my code to a different class containing fragmen

相关标签:
2条回答
  • 2021-01-18 19:27

    the compile time error is suggesting that your ForecastFragment is using the native fragment support app.Fragment, but in your activity you are using a transaction from the support library. You have to be consistent with the import. Change your ForecastFragment in order to make it use the Fragment from the support library

    0 讨论(0)
  • 2021-01-18 19:32

    I don't know what you're doing but it looks like you have a syntax error.

    new com.sunshine.example.sunshine.app.Fragment*()* 
    

    You should put parentheses () at the end of any creating objects statement.

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