NavigationView 应用在 androidx 之后挂起并停止响应

NavigationView app hangs and stop responding after androidx

当我打开其中有 NavigationView 的 activity 时,一切都变黑并挂起并保持这种状态,直到我关闭应用程序,没有发生崩溃。 在我使用 android 工作室迁移到 androidx 之前,该应用程序运行良好。

Android API 版本: 29

Material Library version: i tried 1.0.0 , 1.1.0-alpha07 , 1.1.0-alpha08 , 1.1.0-alpha09

我正在使用 java 8:

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

设备:我的android设备华为EMUI 9.1.0和虚拟设备androidQ

我试图将导航视图更改为那个:

<?xml version="1.0" encoding="utf-8"?>
<com.google.android.material.navigation.NavigationView android:layout_width="match_parent"
    android:layout_height="match_parent"
    xmlns:android="http://schemas.android.com/apk/res/android" />

仍然有同样的问题,屏幕挂起并且在我关闭应用程序之前没有任何反应。

我的导航视图:

<com.google.android.material.navigation.NavigationView xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/drawer_layout"
    android:layout_width="wrap_content"
    android:layout_height="match_parent"
    android:layout_gravity="start"
    android:fitsSystemWindows="true"
    app:menu="@menu/main_drawer"
    app:headerLayout="@layout/nav_header"/>

这是日志的一部分:

2019-09-01 20:13:22.172 11621-11621/com.novaplay.chatunseen D/HwSplineOverScrollerExImpl: initSplineOverScrollerImpl paras: android.widget.OverScroller$SplineOverScroller@dd35b59,com.novaplay.chatunseen.main.MainActivity@11d12be
2019-09-01 20:13:22.172 11621-11621/com.novaplay.chatunseen D/HwSplineOverScrollerExImpl: initSplineOverScrollerImpl: mScrollerVelocity is 0, value is 0
2019-09-01 20:13:22.173 11621-11621/com.novaplay.chatunseen I/FLTAG_FM: loadFeature class:com.huawei.featurelayer.systemfeature.HwWidget.IHwSplineOverScrollerEx
2019-09-01 20:13:22.173 11621-11621/com.novaplay.chatunseen I/FLTAG_SFM: getRequireClassLoader() succ ! className: com.huawei.featurelayer.systemfeature.HwWidget.IHwSplineOverScrollerEx
2019-09-01 20:13:22.173 11621-11621/com.novaplay.chatunseen D/FeatureFactory: loadFeature() : com.huawei.featurelayer.systemfeature.HwWidget.IHwSplineOverScrollerEx
2019-09-01 20:13:22.173 11621-11621/com.novaplay.chatunseen D/FeatureFactory: loadFeature() new IHwSplineOverScrollerEx()
2019-09-01 20:13:22.173 11621-11621/com.novaplay.chatunseen D/HwSplineOverScrollerExImpl: initSplineOverScrollerImpl paras: android.widget.OverScroller$SplineOverScroller@dd55415,com.novaplay.chatunseen.main.MainActivity@11d12be
2019-09-01 20:13:22.173 11621-11621/com.novaplay.chatunseen D/HwSplineOverScrollerExImpl: initSplineOverScrollerImpl: mScrollerVelocity is 0, value is 0
2019-09-01 20:13:23.188 11621-11632/com.novaplay.chatunseen I/play.chatunsee: Background concurrent copying GC freed 30156(709KB) AllocSpace objects, 0(0B) LOS objects, 48% free, 25MB/49MB, paused 115us total 376.680ms
2019-09-01 20:13:25.312 11621-11660/com.novaplay.chatunseen D/IMonitor: Load library imonitor_jni
2019-09-01 20:13:25.320 11621-11660/com.novaplay.chatunseen E/ZrHungImpl:  sendAppFreezeEvent failed!
2019-09-01 20:13:25.619 11621-11632/com.novaplay.chatunseen I/play.chatunsee: Background concurrent copying GC freed 5731(1423KB) AllocSpace objects, 7(3MB) LOS objects, 33% free, 48MB/72MB, paused 9.447ms total 366.235ms
2019-09-01 20:13:27.965 11621-11632/com.novaplay.chatunseen I/play.chatunsee: Background concurrent copying GC freed 367(501KB) AllocSpace objects, 0(0B) LOS objects, 24% free, 75MB/99MB, paused 7.997ms total 349.629ms
2019-09-01 20:13:28.727 11621-11660/com.novaplay.chatunseen E/ZrHungImpl:  sendAppFreezeEvent failed!
2019-09-01 20:13:30.375 11621-11632/com.novaplay.chatunseen I/play.chatunsee: Background concurrent copying GC freed 1085(508KB) AllocSpace objects, 0(0B) LOS objects, 19% free, 102MB/126MB, paused 8.824ms total 399.422ms
2019-09-01 20:13:32.787 11621-11632/com.novaplay.chatunseen I/play.chatunsee: Background concurrent copying GC freed 297(485KB) AllocSpace objects, 0(0B) LOS objects, 15% free, 129MB/153MB, paused 8.129ms total 415.590ms
2019-09-01 20:13:35.282 11621-11632/com.novaplay.chatunseen I/play.chatunsee: Background concurrent copying GC freed 299(488KB) AllocSpace objects, 0(0B) LOS objects, 13% free, 157MB/181MB, paused 7.813ms total 448.718ms
2019-09-01 20:13:37.822 11621-11632/com.novaplay.chatunseen I/play.chatunsee: Background concurrent copying GC freed 2656(596KB) AllocSpace objects, 0(0B) LOS objects, 11% free, 185MB/209MB, paused 8.588ms total 503.426ms
2019-09-01 20:13:40.321 11621-11632/com.novaplay.chatunseen I/play.chatunsee: Background concurrent copying GC freed 898(576KB) AllocSpace objects, 0(0B) LOS objects, 10% free, 213MB/237MB, paused 7.695ms total 491.625ms
2019-09-01 20:13:42.876 11621-11632/com.novaplay.chatunseen I/play.chatunsee: Background concurrent copying GC freed 2762(589KB) AllocSpace objects, 0(0B) LOS objects, 9% free, 241MB/265MB, paused 8.074ms total 528.395ms
2019-09-01 20:13:45.170 11621-11650/com.novaplay.chatunseen I/play.chatunsee: Waiting for a blocking GC ProfileSaver
2019-09-01 20:13:45.442 11621-11632/com.novaplay.chatunseen I/play.chatunsee: Background concurrent copying GC freed 519(537KB) AllocSpace objects, 0(0B) LOS objects, 8% free, 270MB/294MB, paused 8.363ms total 530.013ms
2019-09-01 20:13:45.443 11621-11650/com.novaplay.chatunseen I/play.chatunsee: WaitForGcToComplete blocked ProfileSaver on HeapTrim for 272.538ms
2019-09-01 20:13:48.039 11621-11632/com.novaplay.chatunseen I/play.chatunsee: Background concurrent copying GC freed 1390(551KB) AllocSpace objects, 0(0B) LOS objects, 7% free, 300MB/324MB, paused 8.503ms total 566.817ms
2019-09-01 20:13:50.632 11621-11632/com.novaplay.chatunseen I/play.chatunsee: Background concurrent copying GC freed 350(542KB) AllocSpace objects, 0(0B) LOS objects, 6% free, 329MB/353MB, paused 8.376ms total 560.008ms
2019-09-01 20:13:53.177 11621-11632/com.novaplay.chatunseen I/play.chatunsee: Background concurrent copying GC freed 4264(648KB) AllocSpace objects, 0(0B) LOS objects, 6% free, 357MB/381MB, paused 7.381ms total 571.845ms
2019-09-01 20:13:55.819 11621-11632/com.novaplay.chatunseen I/play.chatunsee: Background concurrent copying GC freed 336(542KB) AllocSpace objects, 0(0B) LOS objects, 5% free, 387MB/411MB, paused 7.786ms total 604.555ms
2019-09-01 20:13:58.454 11621-11632/com.novaplay.chatunseen I/play.chatunsee: Background concurrent copying GC freed 1867(673KB) AllocSpace objects, 0(0B) LOS objects, 5% free, 416MB/440MB, paused 7.083ms total 604.710ms
2019-09-01 20:14:01.045 11621-11632/com.novaplay.chatunseen I/play.chatunsee: Background concurrent copying GC freed 2591(646KB) AllocSpace objects, 0(0B) LOS objects, 5% free, 446MB/470MB, paused 8.514ms total 590.796ms
2019-09-01 20:14:03.682 11621-11632/com.novaplay.chatunseen I/play.chatunsee: Background concurrent copying GC freed 1820(619KB) AllocSpace objects, 0(0B) LOS objects, 4% free, 475MB/499MB, paused 7.535ms total 610.837ms
2019-09-01 20:14:06.325 11621-11632/com.novaplay.chatunseen I/play.chatunsee: Clamp target GC heap from 529MB to 512MB
2019-09-01 20:14:06.325 11621-11632/com.novaplay.chatunseen I/play.chatunsee: Background concurrent copying GC freed 351(543KB) AllocSpace objects, 0(0B) LOS objects, 1% free, 505MB/512MB, paused 7.494ms total 636.569ms
2019-09-01 20:14:06.880 11621-11621/com.novaplay.chatunseen I/play.chatunsee: Waiting for a blocking GC Alloc
2019-09-01 20:14:07.342 11621-11632/com.novaplay.chatunseen I/play.chatunsee: Clamp target GC heap from 535MB to 512MB
2019-09-01 20:14:07.342 11621-11632/com.novaplay.chatunseen I/play.chatunsee: Background concurrent copying GC freed 165(269KB) AllocSpace objects, 0(0B) LOS objects, 0% free, 511MB/512MB, paused 7.174ms total 519.289ms
2019-09-01 20:14:07.343 11621-11621/com.novaplay.chatunseen I/play.chatunsee: WaitForGcToComplete blocked Alloc on HeapTrim for 463.117ms
2019-09-01 20:14:07.343 11621-11621/com.novaplay.chatunseen I/play.chatunsee: Starting a blocking GC Alloc
2019-09-01 20:14:07.425 11621-11621/com.novaplay.chatunseen I/play.chatunsee: Waiting for a blocking GC Alloc
2019-09-01 20:14:07.805 11621-11632/com.novaplay.chatunseen I/play.chatunsee: Clamp target GC heap from 535MB to 512MB
2019-09-01 20:14:07.805 11621-11632/com.novaplay.chatunseen I/play.chatunsee: Background concurrent copying GC freed 7(464B) AllocSpace objects, 0(0B) LOS objects, 0% free, 511MB/512MB, paused 8.261ms total 461.386ms
2019-09-01 20:14:07.806 11621-11621/com.novaplay.chatunseen I/play.chatunsee: WaitForGcToComplete blocked Alloc on HeapTrim for 380.108ms
2019-09-01 20:14:07.806 11621-11621/com.novaplay.chatunseen I/play.chatunsee: Starting a blocking GC Alloc
2019-09-01 20:14:07.806 11621-11621/com.novaplay.chatunseen I/play.chatunsee: Starting a blocking GC Alloc
2019-09-01 20:14:08.224 11621-11621/com.novaplay.chatunseen I/play.chatunsee: Clamp target GC heap from 535MB to 512MB
2019-09-01 20:14:08.224 11621-11621/com.novaplay.chatunseen I/play.chatunsee: Alloc concurrent copying GC freed 8(504B) AllocSpace objects, 0(0B) LOS objects, 0% free, 511MB/512MB, paused 66us total 418.089ms
2019-09-01 20:14:08.224 11621-11621/com.novaplay.chatunseen I/play.chatunsee: Starting a blocking GC Alloc
2019-09-01 20:14:08.639 11621-11621/com.novaplay.chatunseen I/play.chatunsee: Clamp target GC heap from 535MB to 512MB
2019-09-01 20:14:08.640 11621-11621/com.novaplay.chatunseen I/play.chatunsee: Alloc concurrent copying GC freed 3(72B) AllocSpace objects, 0(0B) LOS objects, 0% free, 511MB/512MB, paused 60us total 414.945ms
2019-09-01 20:14:08.640 11621-11621/com.novaplay.chatunseen I/play.chatunsee: Forcing collection of SoftReferences for 102KB allocation
2019-09-01 20:14:08.640 11621-11621/com.novaplay.chatunseen I/play.chatunsee: Starting a blocking GC Alloc
2019-09-01 20:14:09.207 11621-11621/com.novaplay.chatunseen I/play.chatunsee: Clamp target GC heap from 535MB to 512MB
2019-09-01 20:14:09.207 11621-11621/com.novaplay.chatunseen I/play.chatunsee: Alloc concurrent copying GC freed 8285(352KB) AllocSpace objects, 0(0B) LOS objects, 0% free, 511MB/512MB, paused 61us total 566.573ms
2019-09-01 20:14:09.207 11621-11621/com.novaplay.chatunseen I/play.chatunsee: Starting a blocking GC Alloc
2019-09-01 20:14:09.207 11621-11621/com.novaplay.chatunseen I/play.chatunsee: Starting a blocking GC Alloc
2019-09-01 20:14:09.621 11621-11621/com.novaplay.chatunseen I/play.chatunsee: Clamp target GC heap from 535MB to 512MB
2019-09-01 20:14:09.621 11621-11621/com.novaplay.chatunseen I/play.chatunsee: Alloc concurrent copying GC freed 0(15KB) AllocSpace objects, 0(0B) LOS objects, 0% free, 511MB/512MB, paused 391us total 413.826ms
2019-09-01 20:14:09.621 11621-11621/com.novaplay.chatunseen I/play.chatunsee: Starting a blocking GC Alloc
2019-09-01 20:14:10.040 11621-11621/com.novaplay.chatunseen I/play.chatunsee: Clamp target GC heap from 535MB to 512MB
2019-09-01 20:14:10.040 11621-11621/com.novaplay.chatunseen I/play.chatunsee: Alloc concurrent copying GC freed 0(15KB) AllocSpace objects, 0(0B) LOS objects, 0% free, 511MB/512MB, paused 80us total 418.546ms
2019-09-01 20:14:10.040 11621-11621/com.novaplay.chatunseen I/play.chatunsee: Forcing collection of SoftReferences for 411KB allocation
2019-09-01 20:14:10.040 11621-11621/com.novaplay.chatunseen I/play.chatunsee: Starting a blocking GC Alloc
2019-09-01 20:14:10.593 11621-11621/com.novaplay.chatunseen I/play.chatunsee: Clamp target GC heap from 535MB to 512MB
2019-09-01 20:14:10.593 11621-11621/com.novaplay.chatunseen I/play.chatunsee: Alloc concurrent copying GC freed 9(16KB) AllocSpace objects, 0(0B) LOS objects, 0% free, 511MB/512MB, paused 73us total 552.513ms
2019-09-01 20:14:10.593 11621-11632/com.novaplay.chatunseen I/play.chatunsee: WaitForGcToComplete blocked Background on HeapTrim for 2.786s
2019-09-01 20:14:10.596 11621-11621/com.novaplay.chatunseen W/play.chatunsee: Throwing OutOfMemoryError with VmSize  4821432 kB "Failed to allocate a 421520 byte allocation with 357024 free bytes and 348KB until OOM, max allowed footprint 536870912, growth limit 536870912"
2019-09-01 20:14:10.604 11621-11621/com.novaplay.chatunseen I/play.chatunsee: Starting a blocking GC Alloc
2019-09-01 20:14:10.604 11621-11621/com.novaplay.chatunseen I/play.chatunsee: Starting a blocking GC Alloc
2019-09-01 20:14:11.018 11621-11621/com.novaplay.chatunseen I/play.chatunsee: Clamp target GC heap from 535MB to 512MB
2019-09-01 20:14:11.018 11621-11621/com.novaplay.chatunseen I/play.chatunsee: Alloc concurrent copying GC freed 0(15KB) AllocSpace objects, 0(0B) LOS objects, 0% free, 511MB/512MB, paused 58us total 413.271ms
2019-09-01 20:14:11.018 11621-11621/com.novaplay.chatunseen I/play.chatunsee: Starting a blocking GC Alloc
2019-09-01 20:14:11.434 11621-11621/com.novaplay.chatunseen I/play.chatunsee: Clamp target GC heap from 535MB to 512MB
2019-09-01 20:14:11.434 11621-11621/com.novaplay.chatunseen I/play.chatunsee: Alloc concurrent copying GC freed 1(8B) AllocSpace objects, 0(0B) LOS objects, 0% free, 511MB/512MB, paused 69us total 416.031ms
2019-09-01 20:14:11.435 11621-11621/com.novaplay.chatunseen I/play.chatunsee: Forcing collection of SoftReferences for 411KB allocation
2019-09-01 20:14:11.435 11621-11621/com.novaplay.chatunseen I/play.chatunsee: Starting a blocking GC Alloc
2019-09-01 20:14:11.986 11621-11621/com.novaplay.chatunseen I/play.chatunsee: Clamp target GC heap from 535MB to 512MB
2019-09-01 20:14:11.986 11621-11621/com.novaplay.chatunseen I/play.chatunsee: Alloc concurrent copying GC freed 6(160B) AllocSpace objects, 0(0B) LOS objects, 0% free, 511MB/512MB, paused 470us total 551.133ms
2019-09-01 20:14:11.986 11621-11632/com.novaplay.chatunseen I/play.chatunsee: WaitForGcToComplete blocked HeapTrim on HeapTrim for 661.100ms
2019-09-01 20:14:11.986 11621-11621/com.novaplay.chatunseen W/play.chatunsee: Throwing OutOfMemoryError with VmSize  4821432 kB "Failed to allocate a 421520 byte allocation with 251392 free bytes and 245KB until OOM, max allowed footprint 536870912, growth limit 536870912" (recursive case)
2019-09-01 20:14:12.177 11621-11621/com.novaplay.chatunseen W/play.chatunsee: "main" prio=5 tid=1 Runnable
2019-09-01 20:14:12.177 11621-11621/com.novaplay.chatunseen W/play.chatunsee:   | group="main" sCount=0 dsCount=0 flags=0 obj=0x76c31b30 self=0x7568015c00
2019-09-01 20:14:12.177 11621-11621/com.novaplay.chatunseen W/play.chatunsee:   | sysTid=11621 nice=-10 cgrp=default sched=0/0 handle=0x75ee91f548
2019-09-01 20:14:12.177 11621-11621/com.novaplay.chatunseen W/play.chatunsee:   | state=R schedstat=( 50859971379 146534889 4704 ) utm=5015 stm=70 core=4 HZ=100
2019-09-01 20:14:12.177 11621-11621/com.novaplay.chatunseen W/play.chatunsee:   | stack=0x7ffc3b5000-0x7ffc3b7000 stackSize=8MB
2019-09-01 20:14:12.177 11621-11621/com.novaplay.chatunseen W/play.chatunsee:   | held mutexes= "mutator lock"(shared held)
2019-09-01 20:14:12.177 11621-11621/com.novaplay.chatunseen W/play.chatunsee:   native: #00 pc 00000000003c7d4c  /system/lib64/libart.so (art::DumpNativeStack(std::__1::basic_ostream<char, std::__1::char_traits<char>>&, int, BacktraceMap*, char const*, art::ArtMethod*, void*, bool)+220)
2019-09-01 20:14:12.177 11621-11621/com.novaplay.chatunseen W/play.chatunsee:   native: #01 pc 00000000004a5b64  /system/lib64/libart.so (art::Thread::DumpStack(std::__1::basic_ostream<char, std::__1::char_traits<char>>&, bool, BacktraceMap*, bool) const+352)
2019-09-01 20:14:12.177 11621-11621/com.novaplay.chatunseen W/play.chatunsee:   native: #02 pc 00000000004a167c  /system/lib64/libart.so (art::Thread::ThrowOutOfMemoryError(char const*)+152)
2019-09-01 20:14:12.177 11621-11621/com.novaplay.chatunseen W/play.chatunsee:   native: #03 pc 00000000001f6b78  /system/lib64/libart.so (art::gc::Heap::ThrowOutOfMemoryError(art::Thread*, unsigned long, art::gc::AllocatorType)+632)
2019-09-01 20:14:12.177 11621-11621/com.novaplay.chatunseen W/play.chatunsee:   native: #04 pc 00000000001fe470  /system/lib64/libart.so (art::gc::Heap::AllocateInternalWithGc(art::Thread*, art::gc::AllocatorType, bool, unsigned long, unsigned long*, unsigned long*, unsigned long*, art::ObjPtr<art::mirror::Class>*)+8888)
2019-09-01 20:14:12.177 11621-11621/com.novaplay.chatunseen W/play.chatunsee:   native: #05 pc 0000000000146010  /system/lib64/libart.so (art::mirror::Object* art::gc::Heap::AllocObjectWithAllocator<true, true, art::mirror::SetLengthVisitor>(art::Thread*, art::ObjPtr<art::mirror::Class>, unsigned long, art::gc::AllocatorType, art::mirror::SetLengthVisitor const&)+2880)
2019-09-01 20:14:12.177 11621-11621/com.novaplay.chatunseen W/play.chatunsee:   native: #06 pc 000000000011e89c  /system/lib64/libart.so (art::ClassLinker::AllocPointerArray(art::Thread*, unsigned long)+240)
2019-09-01 20:14:12.177 11621-11621/com.novaplay.chatunseen W/play.chatunsee:   native: #07 pc 000000000049ddfc  /system/lib64/libart.so (art::BuildInternalStackTraceVisitor<false>::Init(int)+272)
2019-09-01 20:14:12.177 11621-11621/com.novaplay.chatunseen W/play.chatunsee:   native: #08 pc 000000000049dc50  /system/lib64/libart.so (_jobject* art::Thread::CreateInternalStackTrace<false>(art::ScopedObjectAccessAlreadyRunnable const&) const+260)
2019-09-01 20:14:12.177 11621-11621/com.novaplay.chatunseen W/play.chatunsee:   native: #09 pc 00000000003f6ce0  /system/lib64/libart.so (art::Throwable_nativeFillInStackTrace(_JNIEnv*, _jclass*)+48)
2019-09-01 20:14:12.177 11621-11621/com.novaplay.chatunseen W/play.chatunsee:   native: #10 pc 0000000000143e20  /system/framework/arm64/boot.oat (offset 13b000) (java.lang.Throwable.nativeFillInStackTrace+144)
2019-09-01 20:14:12.177 11621-11621/com.novaplay.chatunseen W/play.chatunsee:   native: #11 pc 000000000003a4c8  /dev/ashmem/dalvik-jit-code-cache (deleted) (java.lang.Throwable.fillInStackTrace+88)
2019-09-01 20:14:12.177 11621-11621/com.novaplay.chatunseen W/play.chatunsee:   native: #12 pc 000000000056ef88  /system/lib64/libart.so (art_quick_invoke_stub+584)
2019-09-01 20:14:12.177 11621-11621/com.novaplay.chatunseen W/play.chatunsee:   native: #13 pc 00000000000d4204  /system/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+200)
2019-09-01 20:14:12.177 11621-11621/com.novaplay.chatunseen W/play.chatunsee:   native: #14 pc 0000000000283fa8  /system/lib64/libart.so (art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::ShadowFrame*, unsigned short, art::JValue*)+344)
2019-09-01 20:14:12.177 11621-11621/com.novaplay.chatunseen W/play.chatunsee:   native: #15 pc 000000000027dfb0  /system/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+968)
2019-09-01 20:14:12.177 11621-11621/com.novaplay.chatunseen W/play.chatunsee:   native: #16 pc 000000000053ea98  /system/lib64/libart.so (MterpInvokeVirtual+588)
2019-09-01 20:14:12.177 11621-11621/com.novaplay.chatunseen W/play.chatunsee:   native: #17 pc 0000000000561614  /system/lib64/libart.so (ExecuteMterpImpl+14228)
2019-09-01 20:14:12.177 11621-11621/com.novaplay.chatunseen W/play.chatunsee:   native: #18 pc 00000000000cd890  /system/framework/boot.vdex (java.lang.Throwable.<init>+30)
2019-09-01 20:14:12.177 11621-11621/com.novaplay.chatunseen W/play.chatunsee:   native: #19 pc 0000000000257cb4  /system/lib64/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEb.llvm.4019025862+488)
2019-09-01 20:14:12.178 11621-11621/com.novaplay.chatunseen W/play.chatunsee:   native: #20 pc 000000000025d7a8  /system/lib64/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*, art::JValue*)+216)
2019-09-01 20:14:12.178 11621-11621/com.novaplay.chatunseen W/play.chatunsee:   native: #21 pc 000000000027df94  /system/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+940)
2019-09-01 20:14:12.178 11621-11621/com.novaplay.chatunseen W/play.chatunsee:   native: #22 pc 000000000053fdd8  /system/lib64/libart.so (MterpInvokeDirect+296)
2019-09-01 20:14:12.178 11621-11621/com.novaplay.chatunseen W/play.chatunsee:   native: #23 pc 0000000000561714  /system/lib64/libart.so (ExecuteMterpImpl+14484)



2019-09-01 20:14:12.341 11621-11621/com.novaplay.chatunseen I/play.chatunsee: Starting a blocking GC Alloc
2019-09-01 20:14:12.341 11621-11621/com.novaplay.chatunseen I/play.chatunsee: Starting a blocking GC Alloc
2019-09-01 20:14:12.759 11621-11621/com.novaplay.chatunseen I/play.chatunsee: Clamp target GC heap from 535MB to 512MB
2019-09-01 20:14:12.759 11621-11621/com.novaplay.chatunseen I/play.chatunsee: Alloc concurrent copying GC freed 0(0B) AllocSpace objects, 0(0B) LOS objects, 0% free, 511MB/512MB, paused 89us total 417.969ms
2019-09-01 20:14:12.759 11621-11621/com.novaplay.chatunseen I/play.chatunsee: Starting a blocking GC Alloc

在我使用备份并再次迁移到 androidx 后修复

迁移到 androidx 后完成导航视图实施, 点击这里
https://www.youtube.com/watch?v=fq8QOnUJ6O4
为了更好的方式:
1. 使用导航抽屉 activity 创建新的 android 项目。
2. 实现监听器:

 navigationView.setNavigationItemSelectedListener(new NavigationView.OnNavigationItemSelectedListener() {
            @Override
            public boolean onNavigationItemSelected(@NonNull MenuItem menuItem) {

switch (menuItem.getItemId()) { case R.id.nav_home: Toast.makeText(getApplicationContext(),"Home is selected",Toast.LENGTH_LONG).show(); break; //other cases you want to add } drawer.closeDrawers(); return false; } });


3. navigationView.bringToFront();

完全可以。