<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/Black"
android:orientation="horizontal">
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/buttonFoo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:drawableStart="@drawable/ic_foo_icon"
android:drawablePadding="8dp"
android:text="@string/foo" />
/androidx.appcompat.widget.LinearLayoutCompat>
The above activity layout would cause the following exception on Android 4.4 when the activity starts:
android.view.InflateException: Binary XML file line #123: Error inflating class <unknown>
It happens only on Android 4.4. All other devices are fine.
Everything will be fine if the following is removed:
android:drawableStart="@drawable/ic_foo_icon"
Is android:drawableStart in androidx.appcompat.widget.AppCompatButton supported by android 4.4?
Why don't you use drawableLeft / drawableRight instead?