Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>you can try something like this:</p> <pre><code>String[] setNameValues = new String[] { "setName1", "setName2", "setName3" }; // Create a simple array adapter (of type string) //with the setName values returned by conn1.execNonquery ListAdapter adapter = new ArrayAdapter&lt;String&gt;(this, android.R.layout.simple_list_item_1, setNameValues); </code></pre> <p>So, you should convert your conn1.execNonQuery(selectList) result to a string array</p> <p>Update:</p> <p>Or you can use a cursor adapter, if your conn1.execNonQuery return a cursor.</p> <p>For example (some lines are delete to make it clear)</p> <pre><code>public class DiagramListCursorAdapter extends CursorAdapter { private boolean dataValid; private boolean autoRequery; private boolean autoRequeryInProgress; private int count = -1; public DiagramListCursorAdapter(Context context, Cursor c, boolean autorequery) { super(context, c, autorequery); } @Override public View newView(final Context context, Cursor cursor, ViewGroup parent) { LayoutInflater inflater = LayoutInflater.from(context); View v = inflater.inflate(R.layout.diagram_item, null); DiagramListCursorWrapper wrapper; wrapper = new DiagramListCursorWrapper(v); v.setTag(wrapper); return v; } @Override public void bindView(View v, Context context, Cursor cursor) { DiagramListCursorWrapper wrapper = (DiagramListCursorWrapper) v.getTag(); wrapper.populateFrom(cursor); } void refresh() { if (getCursor() != null) { getCursor().requery(); } } public class DiagramListCursorWrapper { TextView title; public DiagramListCursorWrapper(View v) { setupViews(v, null); } public DiagramListCursorWrapper(View v, Context context) { setupViews(v, context); } private void setupViews(View v, Context context) { title = (TextView) v.findViewById(R.id.title); icon = (ImageView) v.findViewById(R.id.icon); } public void populateFrom(Cursor cursor) { if (cursor != null) { try { title.setText(cursor.getString(cursor.getColumnIndex(DiagramsADO.DIAGRAM_TITLE))); } catch (Exception e) { } } } } } </code></pre> <p>I hope this helps you</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload