Error: The method replace (int, Fragment) in the type fragmenttransaction are not applicable for the arguments (int, myfragment)

Source: Internet
Author: User

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)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.