Jai
Jai

Reputation: 257

Error inflating androidx.appcompat.widget.SearchView

We are getting crash reports in play store about an inflate exception with the androidx.appcompat.widget.SearchView, in the OnCreateView method where we inflate the layout this way.

val binding = DataBindingUtil.inflate(inflater, R.layout.layout_class_groups, container, false)

The SearchView implementation in the xml is as follows.

   <androidx.appcompat.widget.SearchView
            android:id="@+id/classGroupsSearchView"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="@color/white"
            android:theme="@style/SearchViewStyle"
            app:iconifiedByDefault="false" />

I have used custom style for the SearchView as well.

<style name="SearchViewStyle" parent="Widget.AppCompat.Light.SearchView">
    <item name="android:textSize">16sp</item>
</style>

We are unable to replicate this crash while testing, so how do i fix it?

Upvotes: 6

Views: 380

Answers (0)

Related Questions