Code example for SimpleCursorAdapter

Methods: setStringConversionColumn

0
    */ 
 @SuppressWarnings("deprecation") 
public void setSuggestionSource(Cursor source, String column) {
    String[] from = new String[] { column };
    int[] to = new int[] { android.R.id.text1 };
    SimpleCursorAdapter cursorAdapter = new SimpleCursorAdapter(this.getContext(),
                   android.R.layout.simple_dropdown_item_1line, source, from, to);
    // this is to ensure that when suggestion is selected 
    // it provides the value to the textbox 
    cursorAdapter.setStringConversionColumn(source.getColumnIndex(column));
    _text.setAdapter(cursorAdapter);
 } 
  
 public void setSuggestionSource(ArrayAdapter<String> adp) {
//	    String[] from = new String[] { column }; 
//	    int[] to = new int[] { android.R.id.text1 }; 
//	    SimpleCursorAdapter cursorAdapter = new SimpleCursorAdapter(this.getContext(), 
//	                   android.R.layout.simple_dropdown_item_1line, source, from, to); 
//? 
	    // this is to ensure that when suggestion is selected 
Experience pair programming with AI  Get Codota for Java