Change Chip Widget style programmatically not working – Android

You can’t use the constructor val chip = Chip(context, null, R.style.CustomChipChoice) because the 3rd parameter isn’t the style but the attribute in the theme as R.attr.chipStyle. The Chip hasn’t a constructor with 4 parameters as other components because it extends AppCompatCheckbox which does not support a 4 parameter constructor. However you can use something different. … Read more

Android material chip component crashing app. Unable to inflate xml

Update your app theme to inherit from one of these themes: Theme.MaterialComponents Theme.MaterialComponents.NoActionBar Theme.MaterialComponents.Light Theme.MaterialComponents.Light.NoActionBar Theme.MaterialComponents.Light.DarkActionBar For example: <style name=”AppTheme” parent=”Theme.MaterialComponents.Light.NoActionBar”> Note: Using a Material Components theme enables a custom view inflater Source: https://www.material.io/develop/android/docs/getting-started/