TextInputLayout throws "The style on this component requires your app theme to be Theme.AppCompat (or a descendant)."
As @MikeM. commented on the question there is an issue with the context used to instantiate the Adapter
.
You need to pass the Activity
, not an Application Context
.
The ApplicationContext
doesn't have your app theme.
But pay attention because you are using the com.google.android.material.textfield.TextInputLayout
, check the doc of the Material Components library.
Your app theme should inherit from a Material Components theme.
If you can't change your theme, you can do one of the following:
- Inherit from one of our
Material Components Bridge
themes. - Continue to inherit from an
AppCompat
theme and add some new theme attributes to your theme.