美文网首页
待机和屏保启动冲突

待机和屏保启动冲突

作者: Taleen_d245 | 来源:发表于2017-12-08 11:28 被阅读0次

    待机和屏保启动冲突,可通过kill 进程屏保。

    public static void stoplogcat() throws IOException, InterruptedException { //Log.i(TAG,"................kill logcat................."); Runtime runtime = Runtime.getRuntime(); Process uipro = runtime.exec("ps"); int uipid = 0; BufferedReader input = new BufferedReader(new InputStreamReader( uipro.getInputStream())); String line = null; while ((line = input.readLine()) != null) { if (line.contains("logcat")) { String subs = line.substring(10, 16); String PID = subs.trim(); uipid = Integer.parseInt(PID); System.out.println(uipid); runtime.exec("kill -9 " + uipid); android.os.Process.killProcess(uipid); } } }

    相关文章

      网友评论

          本文标题:待机和屏保启动冲突

          本文链接:https://www.haomeiwen.com/subject/vaqeixtx.html