Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public String searchAll (ArrayList<String> names, ArrayList<String> Email, ArrayList<String> Password)
- {
- db = this.getWritableDatabase();
- Cursor cursor = db.query("contacts",null,null,null,null,null,null);
- if (cursor.moveToFirst())
- {
- int idColIndex = cursor.getColumnIndex("id");
- int nameColIndex = cursor.getColumnIndex("name");
- int emailColIndex = cursor.getColumnIndex("email");
- int passwordColIndex = cursor.getColumnIndex("password");
- do {
- names.add(cursor.getString(nameColIndex));
- Email.add(cursor.getString(emailColIndex));
- Password.add(cursor.getString(passwordColIndex));
- } while (cursor.moveToNext());
- }
- cursor.close();
- db.close();
- }
- SQLiteDatabase db = oh.getReadableDatabase();
- Cursor cursor = db.query("data", new String[] { oh.KEY_ID,
- oh.KEY_METRIC, oh.KEY_ROOL },null,
- null, null, null, null, null);
- if (cursor != null)
- cursor.moveToFirst();
- while (cursor!=null){
- try {
- data.add(cursor.getString(2));
- cursor.moveToNext();
- }catch (Exception e){
- break;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement