Use fragmenttransactionreplace(r.id.content, New Myfragment ()), always error
Error: The method replace (int, Fragment) in the type fragmenttransaction are not applicable for the arguments (int, myfragment)
Baidu, a search of dozens of answers, lying trough the trough, and all that is said:
Lying trough, these fraught of parallel imports ...
Their answer is equal to: someone asked how to shoot the small Japan, he replied, you should take a knife to kill him ...
I asked how to solve the problem, not a detour to solve it in another way.
Android Phone is now basically 4.0 later version, so I do not want to use. support.v4 package to be compatible with the lower version, and directly use the API in the app package
How to solve the problem is to let me guide. Support.v4 package inherit fragmentactivity?
Really is unbearable, from beginning to end carefully studied the code, is no problem?
Finally I wrote it again, found the problem is missing ...
Again from the beginning of comparison found: I rub, my myfragment in the guide is SUPPORT.V4 bag!
so the answer is obvious : Your activity is inconsistent with the fragment in your guide!
Such a simple question on the Internet could not find the answer, really enough!
Error: The method replace (int, Fragment) in the type fragmenttransaction are not applicable for the arguments (int, myfragment)