I have an accessibility service and I want to use it to get the resolution (width and height) of any app the user currently has opened. I don't mean the max resolution of the device I mean the resolution the foreground app is running in which can be lower than the max resolution of the device.
Please I've been stuck on this forever. I tried this but it doesn't work:
WindowManager windowManager = (WindowManager) getSystemService(WINDOW_SERVICE);
Point size = new Point();
windowManager.getDefaultDisplay().getSize(size);
getSize() when called from a service context will always return the max resolution of the device. What else can I try?