Recently Android team(mainly those guys actually) had introduced
I’ve added it to mine project :
Everything looks cool, despite few moments – I can’t find the
toast() method. After few minutes of research I’ve found that
androidx.core.widget package isn’t anymore present within the ktx lib. There is nothing about it mentioned inside Changelog file. That’s kind of strange, cause it was there within
BTW the same strange behaviour applies to
com.google.android.material:material:1.0.0 where in
beta01 I was able to use
MaterialComponents-styles and in the release version Android Studio isn’t able to resolve them.
As usual after few hours of playing with Android Studio(using diff lib versions and invalidating cache) things went back to normal. Problem with styles isn’t valid anymore.
Soooo, the question is:
What was done? Do we have any up to date doc describing all relevant changes?
As this library was archived and partially moved to support, you can see in https://github.com/android/android-ktx/issues/143 that
toast() is removed. So you can downgrade the library to
androidx.core:core-ktx:1.0.0-alpha1 (beta01 or even 0.3).
I don’t know, why this happened.
beta01 warns that
toast() should be replaced with
Toast.makeText(this, message, Toast.LENGTH_SHORT).show();.