待机和屏保启动冲突

待机和屏保启动冲突,可通过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); } } }



你可能感兴趣的:(待机和屏保启动冲突)