How to make skinšote screen?

How to make skinšote screen?
A bunch of code online tipo:
Bitmap bitmap; 
View v1 = MyView.getRootView(); 
v1.setDrawingCacheEnabled(true); 
bitmap = Bitmap.createBitmap(v1.getDrawingCache()); 
v1.setDrawingCacheEnabled(false);

does not work(
July 9th 19 at 10:10
1 answer
July 9th 19 at 10:12
Similar question here How to save to Bitmap fully traced ScrollView?

it uses this method
public static Bitmap getBitmapFromView(View View, int totalHeight, int totalWidth) {
 ReturnedBitmap Bitmap = Bitmap.createBitmap(totalWidth,totalHeight , Bitmap.Config.ARGB_8888);
 Canvas canvas = new Canvas(returnedBitmap);
 BgDrawable Drawable = view.getBackground();
 if (bgDrawable != null)
bgDrawable.draw(canvas);
else
canvas.drawColor(Color.WHITE);
 view.measure( View.MeasureSpec.makeMeasureSpec(totalWidth,View.MeasureSpec.EXACTLY),
View.MeasureSpec.makeMeasureSpec(totalHeight,View.MeasureSpec.EXACTLY));
view.layout(0,0,totalWidth,totalHeight);
view.draw(canvas);
 return returnedBitmap;
 }
It did not help. Bitmap is maintained, and from surface no( - tierra_Schill commented on July 9th 19 at 10:15

Find more questions by tags Android