Advertisement
Guest User

Untitled

a guest
Dec 4th, 2016
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. SimpleCursorAdapter SimpleCursorAdapter;
  2. ListView listWords = (ListView) findViewById(R.id.listWords);
  3. wordsRepo wordsRepo = new wordsRepo(this);
  4. TextView textview= (TextView) findViewById(R.id.textView);
  5.  
  6. private void showWords()
  7. {
  8. Cursor cursor = wordsRepo.getword();
  9.  
  10. if (cursor == null)
  11. {
  12. textview.setText("Error");
  13. return;
  14. }
  15. if (cursor.getCount() == 0)
  16. {
  17. textview.setText("No Words.");
  18. return;
  19. }
  20.  
  21. String[] from = new String[] {word.KEY_EN_NAME};
  22. int[] to = new int[] {android.R.id.text1};
  23.  
  24. SimpleCursorAdapter = new SimpleCursorAdapter(this,android.R.layout.simple_list_item_1,cursor,from,to,0);
  25. listCategories.setAdapter(SimpleCursorAdapter);
  26.  
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement