Open Zhuinden opened 2 years ago
This line doesn't exist DeviceHelper.java:123
This means the file got same changes and raise the question: does the issue still exists ?
Btw, when I see this
The question is valid, if we set minSDk to 19 and loose 0,41 % ? @d4rken
The error is from here, not sure why the line numbers are off.
The SDK inits on the app context, so we get the Display
from a non-ui context.
I wouldn't be opposed to raising the minApi (do we do a major version bump for this?), but I don't think it would solve this.
Even with the legacy code removed )#335) we need the Display
instance for:
DisplayMetrics displayMetrics = new DisplayMetrics();
display.getRealMetrics(displayMetrics);
width = displayMetrics.widthPixels;
height = displayMetrics.heightPixels;
Otherwise we'd have to get one from the dev ( trackDeviceScreen(activity: Activity)
?) (and we'd have to be careful not to leak it). Could maybe be automated by hooking into the Activity lifecycle listeners via the Application instance, but we currently don't explicitly get the Application instance, just a Context
.
Is there a way to do it correctly without a UI context? :thinking: