Android: Screen capturing without root
问题 I tried below code but as I run it gives a black screen image on android mobile and on emulator it gives a file, by opening this file I get message as preview not available . View v = activity.getWindow().getDecorView(); v.setDrawingCacheEnabled(true); v.destroyDrawingCache(); int width = activity.getWindowManager().getDefaultDisplay().getWidth(); int height = activity.getWindowManager().getDefaultDisplay().getHeight(); v.measure(MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED),