incompatible types: HomeFragment cannot be converted to Fragment in Android

This seems to be an import problem.

When using getFragmentMangager(), make sure that your Fragment classes extend android.app.Fragment class.

If by any chance you are using android.support.v4.app.Fragment (see your imports), then you need to use getSupportFragmentManager() instead

Hope it helps

Leave a Comment