Is there an API to detect which theme the OS is using – dark or light (or other)?

Google has just published the documentation on the dark theme at the end of I/O 2019, here. In order to manage the dark theme, you must first use the latest version of the Material Components library: “com.google.android.material:material:1.1.0-alpha06”. Change the application theme according to the system theme For the application to switch to the dark theme … Read more

java.lang.IllegalStateException: Only fullscreen opaque activities can request orientation

In android Oreo (API 26) you can not change orientation for Activity that have below line(s) in style <item name=”android:windowIsTranslucent”>true</item> or <item name=”android:windowIsFloating”>true</item> You have several way to solving this : 1) You can simply remove above line(s) (or turn it to false) and your app works fine. 2) Or you can first remove below … Read more

Interstitial Admob ads: “IllegalStateException: Only fullscreen activities can request orientation”

EDIT Now a newer admob version is available. I confirm that using the latest releases (15.0.1 or newer) the issue doesn’t appear anymore, so you can use the latest version of Admob com.google.firebase:firebase-ads:17.1.2 setting the target version to the latest, if you have used the workaround previously suggested. ———————————————————- Set the target to Android API … Read more

Notifications fail to display in Android Oreo (API 26)

Per the comments on this Google+ post: those [warnings] are currently expected when using NotificationCompat on Android O devices (NotificationCompat always calls setSound() even if you never pass in custom sound). until the Support Library changes their code to use the AudioAttributes version of setSound, you’ll always get that warning. Therefore there’s nothing that you … Read more