I\'m getting an error in this part of code:
private void displayView(int position) { // update the main content by replacing fragments Fragment fragm
This seems to be an import problem.
import
When using getFragmentMangager(), make sure that your Fragment classes extend android.app.Fragment class.
getFragmentMangager()
Fragment
android.app.Fragment
If by any chance you are using android.support.v4.app.Fragment (see your imports), then you need to use getSupportFragmentManager() instead
android.support.v4.app.Fragment
getSupportFragmentManager()
Hope it helps