Моя проблема в том, что когда я открываю приложение на реальном устройстве, оно вылетает. Это не открытие.
Но приложение открывается в эмуляторе. Нет проблем.
В logcat для реального устройства ниже показано:
2019-11-01 18: 07: 32.351 13044-15001 /? W / OpenGLRenderer: Неправильно вызван buildLayer при просмотре: w, уничтожение слоя ...
2019-11-01 18: 07: 32.351 13044-15001 /? W / OpenGLRenderer: Неправильно вызванный buildLayer для View: w, уничтожающий слой ...
В приведенном выше описании я не понимаю значения слова "w", которое уничтожает слой.
Ниже приведен мой 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"
tools:context=".MainActivity">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<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.TabLayout
android:id="@+id/tabs"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:elevation="10dp"
app:theme="@style/ThemeOverlay.AppCompat.Dark"
app:layout_scrollFlags="scroll|enterAlways"
tools:ignore="UnusedAttribute"
app:tabTextAppearance="@style/TabLayoutTextStyle"
app:tabIndicatorColor="@color/tabIndicator"
app:tabIndicatorHeight="4dp"
app:tabSelectedTextColor="@color/colorWhite"/>
</android.support.design.widget.AppBarLayout>
<android.support.v4.view.ViewPager
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/viewPager"
app:layout_behavior="@string/appbar_scrolling_view_behavior"/>
<FrameLayout
android:id="@+id/content_frame"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
<android.support.design.widget.NavigationView
android:id="@+id/nav_view"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
android:fitsSystemWindows="true"
app:headerLayout="@layout/nav_header_main"
app:itemIconTint="@color/red"
app:menu="@menu/activity_main_drawer"/>
</android.support.v4.widget.DrawerLayout>
Это макет списка:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<ListView
android:id="@+id/list"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
</ListView>
</LinearLayout>
Я не могу выяснить, в чем проблема. Пожалуйста, предложите.