更改android中的进程优先级

如何在 Android中更改流程优先级?我在android文档中找到了它的优先级的流程描述和描述

process and thread description

process priorities

但我没有发现任何改变过程优先级的方法.

ps:我需要这个只测试与进程优先级相关的应用程序的某些功能,它不会在程序中使用.

我看到的唯一方法是尝试通过重要性字段来改变优先级,但我认为这是一个坏主意.

解决方法

How to change process priority in Android?

你可以,除了可能在root设备上,然后只是暂时.进程优先级由OS管理.如果您的应用程序位于前台,它将以前台优先级运行.如果您的应用程序不在前台,则它不会以前台优先级运行.

I need this to test only some feature of application which is connected with process priority and it won’t be used in program.

然后使用前台进程进行测试,而不是前进进程进行测试.

The only way I see is to try to change the priority via importance field,but it’s a bad idea I guess.

更改该数字不太可能产生影响. RunningAppProcessInfo是一种输出结构,而不是用于更改通过该结构报告的任何内容的方法.

相关文章

Android 如何解决dialog弹出时无法捕捉Activity的back事件 在...
Android实现自定义带文字和图片的Button 在Android开发中经常...
Android 关于长按back键退出应用程序的实现最近在做一个Andr...
android自带的时间选择器只能精确到分,但是对于某些应用要求...