There is one possibility.
Define the layout of a sentence sentence string, for example. R.layout.li_query_suggestion, which looks like this:
<?xml version="1.0" encoding="utf-8"?> <TextView android:id="@android:id/text1" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@android:color/white" android:gravity="center_vertical" android:minHeight="56dp" android:paddingLeft="16dp" android:paddingRight="16dp" android:textAppearance="?android:attr/textAppearanceListItemSmall" android:textColor="@android:color/black" tools:text="Blah blah blah"/>
Note that the background color is white and the text color is black. You can, of course, change these values.
Then, in the cursor adapter, specify the layout that you created as the line layout. For example:.
CursorAdapter suggestionAdapter = new SimpleCursorAdapter( getActivity(), R.layout.li_query_suggestion, null, new String[]{"name"}, new int[]{android.R.id.text1}, 0);
This will give you something similar to the following: 
Just fyi, my current theme looks like this:
<style name="AppTheme" parent="Theme.AppCompat.NoActionBar"> <item name="colorPrimary">@color/light_blue_500</item> <item name="colorPrimaryDark">@color/light_blue_700</item> <item name="colorAccent">@color/pink_a200</item> <item name="android:windowActionBarOverlay">true</item> <item name="searchViewStyle">@style/CustomSearchView</item> </style>
Justin pollard
source share