1

I am trying to copy files from /data/app folder, but facing the following issues, please advice.

Process suProcess = Runtime.getRuntime().exec("su");
DataOutputStream os = new     DataOutputStream(suProcess.getOutputStream);
  1. Error is, Required : android.os.Process, Found : java.lang.Process in the first line of the code.
  2. Cannot resolve symbol, getOutputStream in the second line.

Kindly let me know why these issues occur, and how do I resolve them. Thanks.

4

1 回答 1

0

android.os.Process,找到:java.lang.Process

确保导入正确的类。

import java.lang.Process;

或者像这样声明你的过程:

java.lang.Process suProcess = Runtime.getRuntime().exec("su"); 

无法解析符号,getOutputStream

getOutputStream是一种方法,那么您需要添加()才能编译您的代码。

DataOutputStream os = new     DataOutputStream(suProcess.getOutputStream());
于 2016-05-04T10:02:03.430 回答