Your Activity should extend from AppCompatActivity , then you call your fragment using getSupportFragmentManager , which should do this.
It will look like this:
getSupportFragmentManager().beginTransaction().replace(R.id.main_container, TabFragment.newInstance()).commit();
source share