the continuation of my question is a driver with it starts a fragment, in this fragment there is a foliage when you click on an element of which one more fragment starts to appear in a new window. The code for this fragment
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { myView = inflater.inflate(R.layout.fragment_scale_mineral, container, false); MainActivity.toggle.setDrawerIndicatorEnabled(false); // получаем значение Bundle bundle = getArguments(); if (bundle != null) { strNameMineral = bundle.getString(KEY_MIN); if (strNameMineral != null) { // меняем заголовок тулбара ((AppCompatActivity) getActivity()).getSupportActionBar().setTitle(strNameMineral); ((AppCompatActivity) getActivity()).getSupportActionBar().setDisplayHomeAsUpEnabled(true); } } return myView; } @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case android.R.id.home: Log.i(LOG_TAG, "нажали кнопку назад"); return true; } return super.onOptionsItemSelected(item); }
Can't access the button back in the bar.