【发布时间】:2012-12-02 12:58:14
【问题描述】:
我想显示我在 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 .....帮助?
【问题讨论】:
标签: android textview runtime execution iptables