android-8.0-oreo

IndexOutOfBoundsException in Android 8.0 outside Code on SpannableStringBuilder.checkRange

点点圈 提交于 2019-12-03 11:04:13
问题 The problem Since the upgrade to Android 8.0 I get many crash reports stating an IndexOutOfBoundsException that occurs outside my code. The crash report There is no code in the android app responsible for the crash and it seems to be a bug in Android itself. java.lang.IndexOutOfBoundsException: at android.text.SpannableStringBuilder.checkRange (SpannableStringBuilder.java:1314) at android.text.SpannableStringBuilder.setSpan (SpannableStringBuilder.java:680) at android.text

Android O - Single line Notification - like the “Android System - USB charging this device”

不羁岁月 提交于 2019-12-03 10:41:11
问题 I would like to have an ongoing notification for my ForegroundService that requires as small place as possible. I like the "Android System - USB charging this device" style, but I cannot find any example how to achieve this. Can anyone point me in the right direction? Update The style is given to the notification if the channel is assigned the importance IMPORTANCE_MIN . It looks like there is no way to use Androids built in style for notifications of IMPORTANCE_MIN to be used with a

Change WiFi hotspot's SSID and password in Android Oreo 8.x

心不动则不痛 提交于 2019-12-03 09:40:23
In my Android application I'm using the following code snippet: @RequiresApi(api = Build.VERSION_CODES.O) private void turnOnHotspot(){ WifiManager manager = (WifiManager) getApplicationContext().getSystemService(Context.WIFI_SERVICE); manager.startLocalOnlyHotspot(new WifiManager.LocalOnlyHotspotCallback(){ @Override public void onStarted(WifiManager.LocalOnlyHotspotReservation reservation) { super.onStarted(reservation); Log.d(TAG, "Wifi Hotspot is on now"); } @Override public void onStopped() { super.onStopped(); Log.d(TAG, "onStopped: "); } @Override public void onFailed(int reason) {

Notification.Builder(context) deprecated Android O [duplicate]

旧巷老猫 提交于 2019-12-03 09:33:14
This question already has an answer here: NotificationCompat.Builder deprecated in Android O 9 answers Notification.Builder(context) has been deprecated recently with the venue of Notification Channels in Android O. PROBLEM: After using Notification.Builder(context, StringID) instead of Notification.Builder(context) I did receive a notification to my Android O device. However, after trying that on an Android 23 (M), I did not receive a notification. I debugged my code and it just stopped executing once the debugger hit the line post Notification.Builder(context, StringID) on Android 23 (M).

Oreo, BLE scanner startScan with PendingIntent not working on Samsung device

北慕城南 提交于 2019-12-03 09:11:18
I am trying to scan for beacons using startScan(filters, settings, callbackIntent) . I have an implementation that works fine for Sony Xperia XZ, and Nexus 5X. The only other device with Android O I have available is a Samsung Galaxy S8, and what works for the other devices produce nothing on the Samsung. (The bluetooth scan is really imbedded in a library module, but even when creating a dummy app the samsung fails, so I'll use that in this example). I have removed the filter and the settings used for startScan since the scan doesn't work without them anyway and these are optional.

app launcher icon changed to default icon on Oreo

情到浓时终转凉″ 提交于 2019-12-03 08:49:57
I have created an Android app with its own launcher icon. It worked well with Nougat. But with Oreo, my icon is replaced by the default Android icon. I have defined ic_launcher.png and ic_launcher_round.png in the mipmap resources for several densities. My manifest contains the following line: android:roundIcon="@mipmap/ic_launcher_round" What should I do to make my own icon appear on Oreo ? For API 26+ default Android application template defines another icon resource folder mipmap-anydpi-v26 That folder (usually) contains two xml files ic_launcher and ic_launcher_round that match icon

Get CPU usage of a device running Android 8 Oreo

别等时光非礼了梦想. 提交于 2019-12-03 06:15:29
I'm really confused. I have just noticed that starting from Android 8 all system calls like /proc/stat will be disabled. Ok, but what is work around to get CPU Usage in Android 8? No system calls at all. Is there some API that I'm not familiar with? I really hope that there is solution which I can't see now. No, all of /proc/stat has been disabled for non-System apps, as a side-channel. More information, with an official response from Google here: https://issuetracker.google.com/issues/37140047 来源: https://stackoverflow.com/questions/46182041/get-cpu-usage-of-a-device-running-android-8-oreo

Adaptive Icon not working

£可爱£侵袭症+ 提交于 2019-12-03 05:40:45
manifest: <application android:name="..." android:allowBackup="false" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:theme="@style/MyTheme" tools:replace="icon,label,theme,name,allowBackup"> under the folder mipmap-anydpi-v26 I have defined ic_launcher.xml : <adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"> <background android:drawable="@color/white"/> <foreground android:drawable="@mipmap/ic_launcher_foreground"/> </adaptive-icon> here is my folder structure : build.gradle: compileSdkVersion = 26 buildToolsVersion = "25.0.2"

Unity game started crashing on android 8

走远了吗. 提交于 2019-12-03 04:41:17
Got following stacktrace from Android Vitals: java.lang.Error: FATAL EXCEPTION [main] Unity version : 5.6.2f1 Device model : samsung SM-G955F Device fingerprint: samsung/dream2ltexx/dream2lte:8.0.0/*****/***********B7:user/release-keys Caused by at bitter.jnibridge.JNIBridge.invoke (Native Method) at bitter.jnibridge.JNIBridge$a.invoke (Unknown Source:20) at java.lang.reflect.Proxy.invoke (Proxy.java:913) at $Proxy1.onBindingDied (Unknown Source) at android.app.LoadedApk$ServiceDispatcher.doConnected (LoadedApk.java:1652) at android.app.LoadedApk$ServiceDispatcher$RunConnection.run (LoadedApk

Oreo - Foreground service does not show foreground notification

蓝咒 提交于 2019-12-03 04:14:52
问题 So far, I've adjsuted my code to use ContextCompat.startForegroundService(context, intentService); to start my service. This way, it works on android < 26 and on android 26 (Oreo) as well. I still see a difference, in android oreo I don't see my custom foreground notification (I only see the "app is running in the background" notification). Do I have to adjust anything there as well? My service looks like this: public class BaseOverlayService extends Service { @Override public void onCreate()