我正在我的应用程序中使用此权限,并且在所有设备和Marhshmallow 6.0设备中都可以正常工作。
不需要WAKE_LOCK许可运行时,因为它的正常许可但在Nougat 7.0设备中出现问题。
应用程序崩溃并"java.lang.SecurityException: Neither user 10799 nor current process has android.permission.WAKE_LOCK"在线发生错误wakelock.acquire();
如何解决?
我正在使用此代码 NavigationGraph Fragment
<fragment
android:id="@+id/editProfileFragment"
android:name="com.uvm.ui.editprofile.EditProfileFragment"
android:label="FragmentFour"
tools:layout="@layout/edit_fragment_profile" >
<action
app:popExitAnim="@anim/nav_default_pop_exit_anim"
app:exitAnim="@anim/nav_default_exit_anim"
app:enterAnim="@anim/nav_default_enter_anim"
app:popEnterAnim="@anim/nav_default_pop_enter_anim"
android:id="@+id/action_editProfileFragment_to_profileFragment"
app:destination="@id/profileFragment" />
</fragment>
Run Code Online (Sandbox Code Playgroud)
然后
navController.navigate(R.id.editProfileFragment);
Run Code Online (Sandbox Code Playgroud)
用于片段导航。它的工作良好,碎片也可以替换,但其他enterAnim, exitAnim属性不起作用。没有动画的片段替换。我该如何解决?还有一个查询是NavigationGraph替换片段还是添加片段?而我怎么能得到堆栈的总数呢?