This question already has an answer here: How to programatically ... Use following code. Bitmap bitmap; View v1 = MyView.getRootView(); v1.
stackoverflow.com