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

Context.startForegroundService() did not then call Service.startForeground()

From Google’s docs on Android 8.0 behavior changes: The system allows apps to call Context.startForegroundService() even while the app is in the background. However, the app must call that service’s startForeground() method within five seconds after the service is created. Solution: Call startForeground() in onCreate() for the Service which you use Context.startForegroundService() See also: Background … Read more

Android 8.0: java.lang.IllegalStateException: Not allowed to start service Intent

I got solution. For pre-8.0 devices, you have to just use startService(), but for post-7.0 devices, you have to use startForgroundService(). Here is sample for code to start service. if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { context.startForegroundService(new Intent(context, ServedService.class)); } else { context.startService(new Intent(context, ServedService.class)); } And in service class, please add the code below for notification: … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)