enter image description here When you click on the item in the menu, a new activity opens, but the top panel disappears.

Menu add code and click processing.

Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.menu_main,menu); return true; } public void onAboutDev(MenuItem item) { Intent intent = new Intent(MainActivity.this, AboutDev.class); startActivity(intent); } 

Layout layout code with which I have a problem:

 <?xml version="1.0" encoding="utf-8"?> <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent"> <TextView android:id="@+id/textView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/about" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintHorizontal_bias="0.5" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" /> </android.support.constraint.ConstraintLayout> 

Here is such a white screen with text, how to fix it?

  • one
    The menu for each activation must be installed separately - eugeneek
  • If you use the NoActionBar theme and use the Toolbar as a menu, then you need to specify it explicitly in the markup, it will not appear. Look at the markup (and code) of the first activation and see how and why the menu appears there, then do the same for your other activites. - pavlofff
  • @pavlofff I do not need the menu in the next activity, I need this standard panel with the name of the application, over which time, the charge of the phone is shown. - IvanOdintsov
  • one
    this is it, if you bother to follow the link above, you can see for yourself. there is also a menu in addition to the name of the annex, if that ... - pavlofff

1 answer 1

Make better fragments.

Check out the tutorial: https://www.youtube.com/watch?v=SpEFzw243T4

If this is not what you need and you really need to "save activations." Copy xml from MainActivity to a new activity and then the menu will appear on the second activation.

  • Not exactly that, but thanks for the tutorial - IvanOdintsov