Advertisement
Guest User

Untitled

a guest
Nov 24th, 2014
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. helper = new DatabaseHelper(getActivity(),null,1);
  2. db = helper.getDatabase();
  3.  
  4. list = (ListView) rootView.findViewById(R.id.listalivro);
  5. Cursor cursor = db.query("livro", campos, null, null, null, null, null);
  6. SimpleCursorAdapter Madapter = new SimpleCursorAdapter(getActivity(),
  7. android.R.layout.simple_list_item_1,
  8. cursor,
  9. new String[] {"ver_livro","ver_capitulo"},
  10. new int[] {R.id.ver_livro,R.id.ver_capitulo }, 0);
  11.  
  12. list.setAdapter(Madapter);
  13. list.setChoiceMode(ListView.CHOICE_MODE_SINGLE);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement