android-11
NameNotFoundException when calling getPackageInfo on Android 11
As stated in https://developer.android.com/preview/privacy/package-visibility: Android 11 changes how apps can query and interact with other apps that the user has installed on a device. Using the new element, apps can define the set of other apps that they can access. This element helps encourage the principle of least privilege by telling the system which other … Read more
Android Studio BumbleBee pair wifi not working
I had this issue; it paired fine the first time in-app but never worked again when trying to pair or connect directly from Android Studio. What I now do to connect/pair is the following: Open your phone’s settings and be sure to enable wireless debugging in developer options Click Pair device with pairing code, and … Read more
How to set fullscreen in Android R?
KOTLIN override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.layout_container) @Suppress(“DEPRECATION”) if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) { window.insetsController?.hide(WindowInsets.Type.statusBars()) } else { window.setFlags( WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN ) } } if this doesn’t help, try to remove android:fitsSystemWindows=”true” in the layout file JAVA class Activity extends AppCompatActivity { @Override @SuppressWarnings(“DEPRECATION”) protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.layout_container); if (Build.VERSION.SDK_INT >= … Read more
requestLegacyExternalStorage is not working in Android 11 – API 30
But now when I targetSdkVersion 30, this no longer seems to work That is correct. Android 11 (API 30+) requestLegacyExternalStorage=true does nothing and you can no longer “opt-out”. It was available in Android 10 to give developers a transition/grace period to be able to migrate to the scoped storage model. Option 1: Migrate data in … Read more
intent.resolveActivity returns null in API 30
This appears to be due to the new restrictions on “package visibility” introduced in Android 11. Basically, starting with API level 30, if you’re targeting that version or higher, your app cannot see, or directly interact with, most external packages without explicitly requesting allowance, either through a blanket QUERY_ALL_PACKAGES permission, or by including an appropriate … Read more