android 截屏问题,先截全屏,再截部分。重复截图,但显示的都是第一次的截图

private Bitmap getBitmap(View view) throws Exception {
View decorView = this.getWindow().getDecorView();
decorView.setDrawingCacheEnabled( true );
decorView.buildDrawingCache();
Bitmap bmp = Bitmap.createBitmap( decorView.getDrawingCache() );
Bitmap cacheBmp=null;
int[] locationarray = new int[2];
view.getLocationOnScreen( locationarray );
if(bmp!=null){
cacheBmp=Bitmap.createBitmap( bmp,locationarray[0],locationarray[1],view.getWidth(), view.getHeight() );
}
decorView.destroyDrawingCache();
bmp.recycle();
return cacheBmp;
}

```public static Bitmap getBackground(View v){
if(v == null){
return null;
}
v.setDrawingCacheEnabled(true);
v.buildDrawingCache();
Bitmap bitmap = Bitmap.createBitmap(v.getDrawingCache());
v.setDrawingCacheEnabled(false);
v.buildDrawingCache(false);
return bitmap;
}


我也遇到这个问题,但是我看不懂你们的回答...