我想使用此代码显示我在 textView 中创建的规则;
.....................................
public void show(View btn) throws IOException{
Show(tv);
}
public final void Show(TextView tv) throws IOException{
Process Q =Runtime.getRuntime().exec("su -c iptables -L INPUT 1 -n -v --line-numbers ");
String pingResult="";
BufferedReader in = new BufferedReader(new
InputStreamReader(Q.getInputStream()));
String inputLine;
while ((inputLine = in.readLine()) != null) {
tv.setText(pingResult+="\n"+inputLine+"\n");
}
in.close();
}
}
问题是它告诉我授予了超级用户权限,但表格没有出现在 TextView 中,即使我使用了 BufferReader ..... 帮助?