'camerax sample: Unresolved reference: WindowManager
I'm trying to compile the sample cameraxbasic but I get this error: Unresolved reference: WindowManager I checked gradle files and there is that dependency.
Solution 1:[1]
I reviewed the library change log at https://developer.android.com/jetpack/androidx/releases/window and adjusted the sample with following these changes to make it work. Hope this helps!
- use
implementation "androidx.window:window:1.1.0-alpha01" - replace
WindowManagerwithWindowInfoTracker - replace
WindowManager(context)withWindowInfoTracker.getOrCreate(view.context) - replace
windowManager.getCurrentWindowMetrics().boundswithWindowMetricsCalculator.getOrCreate().computeCurrentWindowMetrics(requireActivity()).bounds
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | AdamVe |
