내가 새로운 활동을 할 때마다 왜 그런가요?새로운 활동을 만들 때마다 Android App 막대 메뉴가 사라집니다.
예컨대 코드 :
Intent intent = new Intent(getApplicationContext(), NextActivity.class;
startActivity(intent);
앱 표시 줄 메뉴 항목이 사라 졌습니까? :(
사람이 말해 줄 수
그래서 새로운 활동을 열 때마다 무엇을, 같은 응용 프로그램 바 메뉴는 항상 존재 수정 됨:
**activity.xml**
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout
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:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:openDrawer="start">
<include
layout="@layout/app_bar_main"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<android.support.design.widget.NavigationView
android:id="@+id/nav_view"
android:layout_width="wrap_content"
android:layout_height="400dp"
android:layout_gravity="start"
android:fitsSystemWindows="true"
app:headerLayout="@layout/nav_header_main"
app:menu="@menu/activity_main_drawer" />
</android.support.v4.widget.DrawerLayout>
**activity_intention.xml:**
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
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:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:openDrawer="start">
*I'll also include the app_bar_main.xml*
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
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"
android:fitsSystemWindows="true"
tools:context="com.example.beminix.dcar.MainActivity">
<android.support.design.widget.AppBarLayout
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:theme="@style/AppTheme.AppBarOverlay">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="@style/AppTheme.PopupOverlay" />
</android.support.design.widget.AppBarLayout>
<include layout="@layout/content_main"/>
</android.support.design.widget.CoordinatorLayout>
The toolbar that I want to keep using The 3 menu icons are gone so as the title
NextActivity에 대한 XML을 게시 할 수 있습니까? 뿐만 아니라 응용 막대가 표시되는 MainActivity에 대한 xml –
@BlancheNeedsHelp NextActivity보기의 내용을 확인하여 테마를 확인하고 질문을 게시 할 때 관련 물건을 모두 게시하십시오. –
옵션 메뉴를 설정해야합니다. 모든 활동 –