本文整理汇总了Java中android.widget.SimpleCursorAdapter.setCursorToStringConverter方法的典型用法代码示例。如果您正苦于以下问题:Java SimpleCursorAdapter.setCursorToStringConverter方法的具体用法?Java SimpleCursorAdapter.setCursorToStringConverter怎么用?Java SimpleCursorAdapter.setCursorToStringConverter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.widget.SimpleCursorAdapter
的用法示例。
在下文中一共展示了SimpleCursorAdapter.setCursorToStringConverter方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getAutoCompleteAdapter
import android.widget.SimpleCursorAdapter; //导入方法依赖的package包/类
/**
* @param context this
* @param layout support_simple_spinner_dropdown_item
* @return
*/
public ListAdapter getAutoCompleteAdapter(Context context, int layout) {
SimpleCursorAdapter adapter =
new SimpleCursorAdapter(context, layout,
null,
new String[]{FIELD_HWD},
new int[]{android.R.id.text1},
0
);
adapter.setFilterQueryProvider(
new FilterQueryProvider() {
@Override
public Cursor runQuery(CharSequence constraint) {
return getFilterCursor(constraint.toString());
}
}
);
adapter.setCursorToStringConverter(
new SimpleCursorAdapter.CursorToStringConverter() {
@Override
public CharSequence convertToString(Cursor cursor) {
return cursor.getString(1);
}
}
);
return adapter;
}
示例2: getAutoCompleteAdapter
import android.widget.SimpleCursorAdapter; //导入方法依赖的package包/类
public ListAdapter getAutoCompleteAdapter(Context context, int layout) {
SimpleCursorAdapter adapter =
new SimpleCursorAdapter(context, layout,
null,
new String[]{"hwd"},
new int[]{android.R.id.text1},
0
);
adapter.setFilterQueryProvider(
new FilterQueryProvider() {
@Override
public Cursor runQuery(CharSequence constraint) {
return getFilterCursor(constraint.toString());
}
}
);
adapter.setCursorToStringConverter(
new SimpleCursorAdapter.CursorToStringConverter() {
@Override
public CharSequence convertToString(Cursor cursor) {
return cursor.getString(1);
}
}
);
return adapter;
}
示例3: getAutoCompleteAdapter
import android.widget.SimpleCursorAdapter; //导入方法依赖的package包/类
@Override
public ListAdapter getAutoCompleteAdapter(Context context, int layout) {
SimpleCursorAdapter adapter =
new SimpleCursorAdapter(context, layout, null,
new String[] {CustomDictionaryDbHelper.getHeadwordColumnName()},
new int[] {android.R.id.text1},
0
);
adapter.setFilterQueryProvider(
new FilterQueryProvider() {
@Override
public Cursor runQuery(CharSequence constraint) {
return mDbHelper.getFilterCursor(mDictId, constraint.toString());
}
}
);
adapter.setCursorToStringConverter(
new SimpleCursorAdapter.CursorToStringConverter() {
@Override
public CharSequence convertToString(Cursor cursor) {
return cursor.getString(1);
}
}
);
return adapter;
}