I want to capture the contents of ImageView using DrawingCache. I wrote the code below.
iv1 = (ImageView)findViewById(R.id.iv1); iv2 = (ImageView)findViewById(R.id.iv2); iv1.setDrawingCacheEnabled(true); Bitmap myScreenshot = iv1.getDrawingCache(); iv2.setImageBitmap(myScreenshot);
But I get only one image on the screen. Later I found out that myScreenshot is null
I saw many posts regarding the same problem, but no correct solution.
I was thinking of any permissions that we should add in the manifest? or root privileges needed to achieve this? Please help me in solving this problem.
source share