Cannot render MaterialButton with android.material:1.1.x-ThrowExceptions

Exception or error: Whenever I use MaterialButton, I get the following exception in the xml preview: java.lang.IllegalArgumentException: java.lang.ClassCastException I have upgraded to android studio 3.4 and to com.google.android.material:material:1.1.0-alpha05 Version 1.0.0 works but any 1.1.x doesn’t. Is this a problem with the IDE or the library? – For reference, the full stacktrace: java.lang.ClassCastException@d8dc5d1 at sun.reflect.GeneratedMethodAccessor893.invoke(Unknown Source) …

xml – android image button tooltip-ThrowExceptions

Exception or error: I’m trying to build an app with image buttons that work like the action bar but i can’t get them to show a tooltip on long press. <ImageButton android:id=”@+id/editUrgent” style=”?android:attr/borderlessButtonStyle” android:layout_width=”48dp” android:layout_height=”wrap_content” android:layout_centerVertical=”true” android:layout_toLeftOf=”@+id/editImportant” android:hint=”@string/hint_urgent” android:contentDescription=”@string/hint_urgent” android:text=”@string/hint_urgent” android:src=”@drawable/clock_light” /> android:contentDescription works for hovering(s-pen) but long press still does nothing. How to solve: …

How to set Style for a button in Android?-ThrowExceptions

Exception or error: I have defined the below files in res folder. styles_apptheme.xml <?xml version=”1.0″ encoding=”utf-8″?> <!– Generated with http://android-holo-colors.com –> <resources xmlns:android=”http://schemas.android.com/apk/res/android”> <style name=”ButtonAppTheme” parent=”android:Widget.Holo.Light.Button”> <item name=”android:background”>@drawable/apptheme_btn_default_holo_light</item> </style> </resources> themes_apptheme.xml <?xml version=”1.0″ encoding=”utf-8″?> <!– Generated with http://android-holo-colors.com –> <resources xmlns:android=”http://schemas.android.com/apk/res/android”> <style name=”AppTheme” parent=”@style/_AppTheme”/> <style name=”_AppTheme” parent=”Theme.AppCompat.Light”> <item name=”android:editTextBackground”>@drawable/apptheme_edit_text_holo_light</item> <item name=”android:buttonStyle”>@style/ButtonAppTheme</item> </style> </resources> In my …

Change the color of a disabled button in android-ThrowExceptions

Exception or error: Is there a way to change the color of a disabled button in android through styles or some other form ? I currently have the following, drawable/button_default.xml <?xml version=”1.0″ encoding=”utf-8″?> <selector xmlns:android=”http://schemas.android.com/apk/res/android”> <item android:drawable=”@drawable/button_default_shape”/> </selector> drawable/button_default_shape.xml <?xml version=”1.0″ encoding=”utf-8″?> <shape xmlns:android=”http://schemas.android.com/apk/res/android” android:shape=”rectangle”> <solid android:color=”@color/button_default_background”/> <corners android:radius=”3dp”/> </shape> values/styles.xml <style name=”AppTheme.Button”> <item name=”android:background”>@drawable/button_default</item> …