主要代碼以下:圖片
public void shotScreen() {get
getWindow.getDecorView.setDrawingCacheEnabled(true);it
Bitmap bmp = getWindow.getDecorView.getDrawingCache();map
}co
注:上面代碼屢次截屏的時候,獲取的圖片都是同樣的,須要添加一下代碼:void
getWindow.getDecorView.destroyDrawingCache();ab