使用screencap实用程序截取屏幕截图时获取空白屏幕

时间:2013-03-29 07:30:59

标签: android

我从我的应用程序中获取了android设备的屏幕截图,在我的huawei设备中没有screencap实用程序,但现在我已经从其他设备中添加它,现在我可以使用screencap捕获屏幕但是只有通知栏是可见,休息图像为空白。

1 个答案:

答案 0 :(得分: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();