public void screenshot(View view)throws Exception {
view.setDrawingCacheEnabled(true);
Bitmap screenshot = view.getDrawingCache();
String filename = "screenshot.png";
try {
File f = new File(Environment.getExternalStorageDirectory(), filename);
f.createNewFile();
OutputStream outStream = new FileOutputStream(f);
screenshot.compress(Bitmap.CompressFormat.PNG, 100, outStream);
outStream.close();
} catch (IOException e) {
e.printStackTrace();
}
view.setDrawingCacheEnabled(false);
}
'안드로이드 > ADB & Rooting' 카테고리의 다른 글
ADB in root mode (0) | 2011.08.14 |
---|---|
ADB Shell을 root권한으로 실행하는 방법 (0) | 2011.08.14 |
How to Use Android ADB Command Line Tool (0) | 2011.08.14 |
[Android] 소스에서 Shell Command, Script 실행하는 법 (0) | 2011.08.14 |
ADB Shell Command Reference (0) | 2011.08.14 |