android-8.0-oreo

FCM : Unable to instantiate receiver com.google.firebase.iid.FirebaseInstanceIdReceiver:

无人久伴 提交于 2019-12-10 11:59:46
问题 App is crashing while receiving push notification in Oreo(8.0) only . java.lang.RuntimeException: Unable to instantiate receiver com.google.firebase.iid.FirebaseInstanceIdReceiver: java.lang.ClassCastException: android.content.ContextWrapper cannot be cast to android.app.ContextImpl at android.app.ActivityThread.handleReceiver(ActivityThread.java:3236) at android.app.ActivityThread.-wrap17(Unknown Source:0) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1677) at android.os

Oreo: startService() doesn't throw IllegalStateException when called in background

偶尔善良 提交于 2019-12-10 10:24:09
问题 According to the background execution limits introduced in Android Oreo, calling startService when the app is in background should throw an IllegalArgumentException . Check this question: Android 8.0: java.lang.IllegalStateException: Not allowed to start service Intent. I created a sample app targetting Android Oreo that does the following: @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); new Handler()

Invalid UUID of storage gained from Android StorageManager?

筅森魡賤 提交于 2019-12-10 09:08:11
问题 I lost whole day fighting with something trivial, but now I just give up and need your help. In new Oreo API for reading app code/data/cache/ size we need storage UUID (StorageStatsManager.queryStatsForUid(UUID storageUuid, int uid)). The storage UUID is possible to fetch from StorageManager.getStorageVolumes() which returns list of all storages which contains also the UUIDs. And there the problem begins: The UUID from returned list is in String format while StorageStatsManager

Android 8.0 Oreo - Accounts

不问归期 提交于 2019-12-09 18:15:15
问题 In my app, I need to known if there is any Google account or any Samsung account. Up to Android 7 it was easy to get this information with something like: Account[] accounts = AccountManager.get(getContext()) .getAccountsByType("com.google") But with the event of Oreo this does not work anymore. EDIT: see official information on this subject: In Android 8.0 (API level 26), apps can no longer get access to user accounts unless the authenticator owns the accounts or the user grants that access.

Android studio Emulator ( device unauthorized)

拥有回忆 提交于 2019-12-09 08:08:58
问题 I know that on a normal device I have to authorize the debugging process, but Authorizing it on an emulator is my first time. I just installed my first emulator on my home pc to do some work stuff, and this poped up. Any idea what is the cause or is it normal for android o api 26 google play SDK? PS: I am using windows version at home. 回答1: Issue Resolved. Step 1- Made a new emulator(Any). Step 2- then fixed another problem the black screen by changing the settings to use hardware graphics.

startService() throws java.lang.IllegalStateException

对着背影说爱祢 提交于 2019-12-08 19:28:53
问题 From onCreate() of my Activity, I am trying to start a service via following code: Intent intent = new Intent(); intent.setClassName(SERVICE_PKG_NAME, SERVICE_NAME); context.startService(intent); //context = MainActivity.this However, I receive following exception: java.lang.IllegalStateException: Not allowed to start service Intent (service-name) : app is in background Any idea what could be reason for this? Stuck on it for few hours now. 回答1: For cases involving need to invoke service of

Firebase messaging: default notification channel doesn't work

*爱你&永不变心* 提交于 2019-12-08 19:14:27
问题 When I send notifications from Firebase console without channel specified on Android Oreo it must use "Miscellaneous" channel OR if provided default channel from Android manifest. So I create and provide default channel in my app: // Application onCreate if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { val manager = getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager val channelId = getString(R.string.notification_channel_id) if(manager.getNotificationChannel(channelId)

Android O Preview findViewById compile error

一世执手 提交于 2019-12-08 16:31:55
问题 I tried to test the Android O Developer Preview second phase. After the project was created, I just clicked build and run but I didn't have any success. Android default generated code below: Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); compile error occurred. Error:(18, 37) error: reference to findViewById is ambiguous both method findViewById(int) in Activity and method <T>findViewById(int) in AppCompatActivity match where T is a type-variable: T extends View declared in method <T

Error on findViewById after upgrading to compile sdk version

℡╲_俬逩灬. 提交于 2019-12-08 16:27:32
问题 After upgrading to compile SDK version 26, all findViewById showing error: not enough information to infer parameter T in fun findViewById(id: Int): T! 回答1: This is because as of Android O, we don't need to cast it. There are a few options. Replace: val textInput = findViewById(R.id.edit_text) as TextInputLayout With either: val textInput:TextInputLayout = findViewById(R.id.edit_text) Or: val textInput = findViewById<TextInputLayout>(R.id.edit_text) If you want to know what happened under the

Autofill framework updates 8.1 cause crash to EditText

孤者浪人 提交于 2019-12-08 16:09:14
问题 I updated my phone to 8.1 from 8.0 and now I am getting this crash when I am trying to tap any EditText or com.rengwuxian.materialedittext.MaterialEditText on my app (which is built with API Level 25). FATAL EXCEPTION: main java.lang.NullPointerException: activityToken at android.os.Parcel.readException(Parcel.java:2010) at android.os.Parcel.readException(Parcel.java:1950) at android.view.autofill.IAutoFillManager$Stub$Proxy.startSession(IAutoFillManager.java:381) at android.view.autofill