Search code examples
androidandroid-layoutandroid-mediaprojection

Is there anyway to capture hardware accelerated views without using media projection API?


I am trying to get screenshot of an activity that contains hardware accelerated view's so , Is there a way to get a activity screenshot without using MediaProjection API or getting the hardware accelerated view's bitmap only ?


Solution

  • You can use PixelCopy API https://developer.android.com/reference/android/view/PixelCopy

    public static void request (SurfaceView source, 
                Bitmap dest, 
                PixelCopy.OnPixelCopyFinishedListener listener, 
                Handler listenerThread)