Created
September 13, 2019 13:56
-
-
Save PiotrPrus/d0bd81ea5199c73a5a8afa9856b302ba to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private fun takeScreenshot() { | |
val fullScreen = requireActivity().window.decorView.rootView | |
bitmapBackground = Bitmap.createBitmap(fullScreen.width, fullScreen.height, Bitmap.Config.ARGB_8888) | |
canvasFullscreen = Canvas(bitmapBackground) | |
fullScreen.draw(canvasFullscreen) | |
bitmapBackgroundDrawable = BitmapDrawable(resources, bitmapBackground) | |
requireActivity().window.setBackgroundDrawable(bitmapBackgroundDrawable) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment