Mario Adam05/26/2023, 6:55 AM
which is only available at API level 31+. My app needs to use 29 as min sdk (as I unfortunately have to support devices with this level). How can I write an own extension method, that will be used when using min sdk 29, but gets replaced by the native implementation at level 31+?
lazynoda05/26/2023, 7:28 AM
and act accordingly. That's what classes like
Build.VERSION.SDK_INT >= 31
are so on are doing. https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:core/cor[…]ndroidx/core/content/ContextCompat.java;l=582?q=ContextCompat