Closed tmehta813 closed 3 years ago
I had done something similar at some point, see
https://gist.github.com/mtsahakis/a4dca46b80cb8ac2cd100a7a52f65b1d https://gist.github.com/mtsahakis/5c709bbd9cf5074a377e6e3114c0e4b6
Hope it helps,
Manos
Thank you for you response, Can we also control it from notification?
I would assume so, just start the service from the notification https://stackoverflow.com/questions/6422319/start-service-from-notification
Hmm, my code won't compile when I use PixelFormat.RGBA_8888
. I have to change to ImageFormat, but then I get exceptions when image = mImageReader.acquireLatestImage();
. I've been through all the comments in a SO post that you created, but it is still not working for me. I'd love it if you can take a look and give me a hand. Thanks!
It should compile as it is just a warning. I added a @SuppressLint("WrongConstant") annotation. If you look into the source code of ImageReader, it states
`* @param format The format of the Image that this reader will produce. This
So could be something wrong with the @Format annotation.
As in my app we don't have any activity, Can we record screen in service ?