[Solved] Android app crashes by switching the activity


Replace R.id.tvFeed with Framelayout’s id or default id android.R.id.content.

if (savedInstanceState == null) {
            getFragmentManager().beginTransaction()
                    .add(android.R.id.content, new PlaceholderFragment())
                    .commit();
        }

and remove the code from the onOptionsItemSelected() method.

if (id == R.id.tvFeed) {
            return true;
        }

solved Android app crashes by switching the activity