2013-03-29 178 views

回答

0
adb shell /system/bin/screencap -p /sdcard/img.png this is a shell command take screenshot simple and fast 

Try this 

Process sh = Runtime.getRuntime().exec("su", null,null); 
OutputStream os = sh.getOutputStream(); 
os.write(("/system/bin/screencap -p " + "/sdcard/img.png").getBytes("ASCII")); 
      os.flush(); 
      os.close(); 
      sh.waitFor(); 
+0

我已經實現了相同的代碼,但得到空白屏幕的問題 – user2211088