Cannot resolve method 'add(int, com.example.**.beatle.app.MainActivity.PlaceholderFragment)

You are using FragmentActivity and getSupportFragmentManager(). Therefore, PlaceholderFragment needs to inherit from android.support.v4.app.Fragment, not android.app.Fragment.


Use

 import android.support.v4.app.Fragment; 

instead of

import android.app.Fragment;

All over in the project.

Also, use support library for FragmentManager and FragmentTransaction.


If you use AndroidX of Andorid Jetpack, then use,

androidx.fragment.app.Fragment

instead of,

import android.app.Fragment;
// or
import android.support.v4.app.Fragment;