android-8.0-oreo

Unable to save image file in android oreo update. How to do it?

社会主义新天地 提交于 2019-12-17 05:11:43
问题 I can't save an image file in android oreo(8.0) api 26. The code is working perfectly in api level 25 (7.0) and I didn't find any changes in the documentation "Android 8.0 Behavior Changes" Here is my code String root = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES).toString(); File myrootDir = new File(root); if (!myrootDir.exists()) { myrootDir.mkdir(); } File myDir = new File(root + "/Myimages"); if (!myDir.exists()) { myDir.mkdir(); } final String fname =

Disabling Android O auto-fill service for an application

别说谁变了你拦得住时间么 提交于 2019-12-17 05:02:34
问题 Android O has the feature to support Auto-filling for fields. Is there any way I can disable it for a specific application. That is I want to force my application not to use the auto-fill service. Is it possible ? To block autofill for an entire activity, use this in onCreate() of the activity: getWindow() .getDecorView() .setImportantForAutofill(View.IMPORTANT_FOR_AUTOFILL_NO_EXCLUDE_DESCENDANTS); Is there any better method than this ? 回答1: Is it possible ? Not that I am aware of. Certainly,

Android O - Old start foreground service still working?

孤街醉人 提交于 2019-12-17 04:28:39
问题 So, with Android O, you need to have your service running as a foreground service if you want to receive more than just a few location updates per hour. I noticed that the old method for starting a foreground service does seem to work on O. i.e. startForeground(NOTIFICATION_ID, getNotification()); According to the behaviour changes guide here: https://developer.android.com/preview/behavior-changes.html The NotificationManager.startServiceInForeground() method starts a foreground service. The

On Android 8.1 API 27 notification does not display

隐身守侯 提交于 2019-12-17 04:28:19
问题 I get Toast on Android 8.1 API 27: Developer warning for package "my_package_name" Failed to post notification on ... Logcat includes next strings: Notification: Use of stream types is deprecated for operations other than volume control W/Notification: See the documentation of setSound() for what to use instead with android.media.AudioAttributes to qualify your playback use case E/NotificationService: No Channel found for pkg=my_package_name The full information in the Toast and in Logcat can

Background service for android oreo

无人久伴 提交于 2019-12-17 03:40:20
问题 How to continue background service in android Oreo without showing notification dot? i continues my background service using notification but i don't want to show notification for running service. 回答1: If you would have read the Android Oreo 8.0 Documentation properly somewhere in here, you might not have posted this question here. Step 1: Make sure you start a service as a foreground Service as given in below code ContextCompat.startForegroundService(mainActivity, new Intent(getContext(),

Notification not showing in Oreo

天涯浪子 提交于 2019-12-16 19:32:21
问题 Normal Notification Builder doesn't show notifications on Android O. How could I show notification on Android 8 Oreo? Is there any new piece of code to add for showing notification on Android O? 回答1: In Android O it's a must to use a channel with your Notification Builder below is a sample code : // Sets an ID for the notification, so it can be updated. int notifyID = 1; String CHANNEL_ID = "my_channel_01";// The id of the channel. CharSequence name = getString(R.string.channel_name);// The

how to start a background service in oreo?

主宰稳场 提交于 2019-12-14 03:59:41
问题 by default all the service starts in Background using startService() before oreo version , but in oreo there is some restriction to start a service in background, Can I start a background service in oreo using startService() ? 回答1: You can use startService() as long as your app is in foreground , if your app goes background and you call startService() you will get IllegalStateException Alternatively you can use startForeground() to start a service From documentation While an app is in the

Alarmmanager does not fire Service after more than 1 Hour - or when the app is in doze… - Android Oreo [closed]

风流意气都作罢 提交于 2019-12-14 03:25:34
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 8 months ago . I try to set up an alarm with Alarmmanager and fire a service five times. I try to fire it after 30 minutes after the time is set. After 1 hour, after 2 hours, 3 hours and 5 hours - but it does not really work... I tried alarmmanager.setAlarmClock --> it does not work... alarmmanager.setExactAndAllowWhileIdle -

Lauching a task when WIFI connects on Android Oreo or newer

て烟熏妆下的殇ゞ 提交于 2019-12-13 20:23:47
问题 I have an app that run some security checks and alerts the user using notifications when the device connects to a WIFI network with an specific SSID. The app run checks in background and if there is some security issue alerts the user using notifications. The issue is that I was using a broadcast receiver for this but with Android Oreo or newer is not working any more. I was reading a lot and I can't find a way for running some background action exactly when the WIFI connection is turned on.

NotificationChannel playing wrong sound in Oreo

爱⌒轻易说出口 提交于 2019-12-13 13:15:59
问题 I have this weird problem with NotificationChannel sound in devices running Android Oreo. Lets say i have two sound files in my project raw directory: a.mp3 c.mp3 Then on first installation of an app i assign those sounds to different notification channels using their uri (for example): android.resource://myapp/2131558403 (for sound a.mp3) android.resource://myapp/2131558404 (for sound c.mp3) At this point everything works as expected. Problem appears when i start adding new sounds (in front