android-8.0-oreo
How to make adb shell ps list all processes in Android O?
adb shell ps -A is listing all processes in android-8.0-O release. I think Google has upgraded ps binary in this release.
NotificationChannel issue in Android O
As it is written in Android Documentation: https://developer.android.com/preview/features/notification-channels.html If you target Android O and post a notification without specifying a valid notifications channel, the notification fails to post and the system logs an error. To solve this issue you need to create a NotificationChannel. NotificationManager mNotificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); // The id of the channel. … Read more
Autosizing of TextView doesn’t work (Android O)
Additional to the other correct answers I found another point which prevents autosizing to work. Do not use android:singleLine=”true” together with autosizing. Use the newer android:maxLines=”1″ instead.
Setting up Gradle for api 26 (Android)
Have you added the google maven endpoint? Important: The support libraries are now available through Google’s Maven repository. You do not need to download the support repository from the SDK Manager. For more information, see Support Library Setup. Add the endpoint to your build.gradle file: allprojects { repositories { jcenter() maven { url ‘https://maven.google.com’ } … Read more
Android vibrate is deprecated. How to use VibrationEffect in Android>= API 26?
with kotlin private fun vibrate(){ val vibrator = context.getSystemService(Context.VIBRATOR_SERVICE) as Vibrator if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { vibrator.vibrate(VibrationEffect.createOneShot(200, VibrationEffect.DEFAULT_AMPLITUDE)) } else { vibrator.vibrate(200) } }
Unable to resume activity with java.lang.IllegalArgumentException on Android api >=24
catch (Exception e) { if (!mInstrumentation.onException(r.activity, e)) { throw new RuntimeException( “Unable to resume activity ” + r.intent.getComponent().toShortString() + “: ” + e.toString(), e); } } it’s a chained exeption so inspect e.getCause() stacktrace -> till cause will be null if you’ll not find it look at the method in activity thread which invokes try … Read more
Android 8.0 Oreo crash on focusing TextInputEditText
I ran into this too. It turns out the issue was caused by setting the hint text on the EditText nested inside the TextInputLayout. I did some digging and found this nugget in the 26.0.0 Beta 2 release notes. Android Support Release Notes June 2017 TextInputLayout must set hints on onProvideAutofillStructure() That led me to … Read more
“Not enough information to infer parameter T” with Kotlin and Android
You must be using API level 26 (or above). This version has changed the signature of View.findViewById() – see here https://developer.android.com/about/versions/oreo/android-8.0-changes#fvbi-signature So in your case, where the result of findViewById is ambiguous, you need to supply the type: 1/ Change val listView = findViewById(R.id.list) as ListView to val listView = findViewById<ListView>(R.id.list) 2/ Change this.label = … Read more
Notification not showing in Oreo
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 user-visible name of the channel. … Read more