Issue
My Android Studio version:
- version: 4.2.2
- Settings->Inspections-> Calling new methods on older versions: DID CHECK (severity: error)
My project:
- compileSdkVersion 30
- minSdkVersion 21
- targetSdkVersion 30
My snippet code:
myActivity.getWindowManager().getCurrentWindowMetrics();
Method getCurrentWindowMetrics()
of class WindowManager
is ONLY available on Android 11 (see here: https://developer.android.com/reference/android/view/WindowManager#getCurrentWindowMetrics())
My question:
why don't Android Studio warn me about using new method:getCurrentWindowMetrics
on older OS?
Solution
This bug happens when using navigation-fragment-ktx
library version 2.4.x. It's fixed in recent versions, see a bug report.
Answered By - Derek K
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.