Android棉花糖动态权限更改会杀死所有应用程序进程 [英] Android marshmallow dynamic permission change kills all application processes

查看:163
本文介绍了Android棉花糖动态权限更改会杀死所有应用程序进程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

观察:手动更改Android应用程序的权限会终止该应用程序的所有进程.

Observation: Manually changing permission of Android application killed all processes for this application.

过程:转到设置"->应用程序",选择应用程序和权限".禁用权限之一. 设备:运行Android Marshmallow 6.0的Nexus 6设备

Procedure: Go to Settings->Apps Select application and Permissions. Disable one of the permissions. Device: Nexus 6 device running Android Marshmallow 6.0

当我从启动器启动应用程序时,它启动了在更改此应用程序的许可之前最重要的活动.这与我们通过从UI多任务菜单中拔出应用程序来终止应用程序进程时的行为不同.在这种情况下,将先创建启动器活动. 也就是说,为了使应用程序在更改权限后启动时能够正常运行,它不依赖于要启动的启动器活动.

When I started the application from the launcher, it started the activity that was on top before permission of this application was changed. That is a different behavior from when we kill the application process by swiping out the application from UI multi-task menu. In that case, launcher activity is created first. That is, for application to work correctly when launched after changing permission, it cannot have a dependency on launcher activity to be started.

在所有Android 6.0+设备上具有动态权限的这种预期行为是吗?为什么与从UI多任务菜单中刷掉应用程序进程杀死应用程序的行为有何不同?

Is this expected behavior with dynamic permissions on all Android 6.0+ devices? Why is there a difference in behavior from when the application process is killed by swiping it out from UI multitask menu?

推荐答案

也就是说,要使应用程序在更改权限后启动时能够正常工作,它就不依赖于启动器活动的启动.

That is, for application to work correctly when launched after changing permission, it cannot have a dependency on launcher activity to be started.

多年来一直是这种情况.例如,如果您的进程由于内存不足而终止,但是当用户访问概述屏幕(您称为"UI多任务"菜单"),然后返回到您的应用,控件将返回到用户上一次执行过的活动(即,位于BACK堆栈顶部的活动)的新实例.

That has been the case for years. For example, if your process is terminated due to low memory conditions, but the user has been in it recently (say, within the past half-hour), when the user visits the overview screen (what you call the "UI multi-task menu") and goes to return to your app, control will return to a fresh instance of whatever activity the user had been in last (i.e., had been on the top of the BACK stack).

在所有Android 6.0+设备上具有动态权限的这种预期行为是吗?

Is this expected behavior with dynamic permissions on all Android 6.0+ devices?

是的.在您的所有以前的Android设备中,这也是预期的行为,对于其他情况,您的进程已终止,但您的任务仍然悬而未决且是最新的.

Yes. It is also expected behavior in all previous Android devices, for other cases where your process was terminated but your task is still outstanding and recent.

为什么与从UI多任务菜单中刷掉应用程序进程杀死行为的行为有何不同?

Why is there a difference in behavior from when the application process is killed by swiping it out from UI multitask menu?

从概述屏幕上轻扫任务会删除该任务.因此,当用户尝试返回到您的应用程序时(例如,通过主屏幕启动器图标),该任务将无法重用.

Swiping a task off the overview screen removes that task. Hence, that task cannot be reused when the user tries returning to your app (e.g., via a home screen launcher icon).

这篇关于Android棉花糖动态权限更改会杀死所有应用程序进程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆