Change this
dataAdapter = new SimpleCursorAdapter(getActivity().getBaseContext(), R.layout.fragment_recherhcer,db.getAllVillesAsCursor(),columns,to);
to
dataAdapter = new SimpleCursorAdapter(getActivity().getBaseContext(), R.layout.item_to_search,db.getAllVillesAsCursor(),columns,to);
cause TextView
with id tv_ville_secteur
is in item_to_search.xml
.
Also
SimpleCursorAdapter(Context context, int layout, Cursor c, String[] from, int[] to)
This constructor was deprecated in API level 11. This option is discouraged, as it results in Cursor queries being performed on the application's UI thread and thus can cause poor responsiveness or even Application Not Responding errors. As an alternative, use LoaderManager with a CursorLoader.
Should not use the above
SimpleCursorAdapter(Context context, int layout, Cursor c, String[] from, int[] to, int flags)
Standard constructor.