Android O Replacement for getRunningServices

It is intentional that there is no replacement for this function. It is not too clear from the documentation, but from the docs: Note: this method is only intended for debugging or implementing service management type user interfaces. Basically, using the method to check other apps services was an unintended side-effect, so Google decided to … 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

Android O – Old start foreground service still working?

This worked for me. In Activity class, start service using startForegroundService() instead of startService() Intent myService = new Intent(this, MyService.class); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { startForegroundService(myService); } else { startService(myService); } Now in Service class in onStartCommand() do as following @Override public int onStartCommand(Intent intent, int flags, int startId) { …… if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) … Read more

Disabling Android O auto-fill service for an application

Currently there is no direct way to disable the autofill for an entire application, since the autofill feature is View specific. You can still try this way and call BaseActivity everywhere. public class BaseActivity extends AppCompatActivity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); disableAutofill(); } @TargetApi(Build.VERSION_CODES.O) private void disableAutofill() { getWindow().getDecorView().setImportantForAutofill(View.IMPORTANT_FOR_AUTOFILL_NO_EXCLUDE_DESCENDANTS); } } You … Read more

Failed to post notification on channel “null” Target Api is 26

From the developer documentation: When you target Android 8.0 (API level 26), you must implement one or more notification channels to display notifications to your users. int NOTIFICATION_ID = 234; NotificationManager notificationManager = (NotificationManager) ctx.getSystemService(Context.NOTIFICATION_SERVICE); String CHANNEL_ID; if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) { CHANNEL_ID = “my_channel_01”; CharSequence name = “my_channel”; String Description = “This is my … Read more

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