Help with my ListView

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

Help with my ListView

Postby javdroid » Fri Feb 19, 2010 2:24 pm

Hello,


I have a problem to list data from my query.
screen appears in black.


my query:

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.  
  2. public static Cursor fetchProduct(String dRecogido) throws SQLException {
  3.  
  4.  
  5.  
  6. Cursor cursor =
  7.  
  8.  
  9.  
  10. mDb.query(DATABASE_TABLE, new String[] { KEY_ROWID, KEY_CODE,
  11.  
  12.  
  13.  
  14. KEY_NOME, KEY_PRICE }, KEY_NAME + "=" + "'"+ dRecogido +"'", null, null, null,
  15.  
  16.  
  17.  
  18. null, null);
  19.  
  20.  
  21.  
  22. if (cursor != null) {
  23.  
  24.  
  25.  
  26. cursor.moveToFirst();
  27.  
  28.  
  29.  
  30. }
  31.  
  32.  
  33.  
  34. return cursor;
  35.  
  36.  
  37.  
  38. }
  39.  
  40.  
Parsed in 0.031 seconds, using GeSHi 1.0.8.4


and my SimpleCursorAdapter
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.  
  2.  
  3.  
  4. private void showData() {
  5.  
  6.  
  7.  
  8. mCursor = ProductsDdAdapter.fetchProduct(dRecogido);
  9.  
  10.  
  11.  
  12. startManagingCursor(mCursor);
  13.  
  14.  
  15.  
  16. String[] from = new String[] { ProductsDdAdapter.KEY_CODE,
  17.  
  18.  
  19.  
  20. ProductsDdAdapter.KEY_NAME, ProductsDdAdapter.KEY_PRICE };
  21.  
  22.  
  23.  
  24. int[] to = new int[] { R.id.textCODIGO, R.id.textNOMBRE,
  25.  
  26.  
  27.  
  28. R.id.textPRECIO };
  29.  
  30.  
  31.  
  32. SimpleCursorAdapter la = new SimpleCursorAdapter(this, R.layout.listodatos, mCursor, from, to);
  33.  
  34.  
  35.  
  36. setListAdapter(la);
  37.  
  38.  
  39.  
  40. }
  41.  
  42.  
Parsed in 0.032 seconds, using GeSHi 1.0.8.4


Did I do wrong?
Or I needed to do?



thanks



best regards
javdroid
Once Poster
Once Poster
 
Posts: 1
Joined: Sun Feb 14, 2010 11:01 pm

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: No registered users and 7 guests