Guest User

Untitled

a guest
Oct 23rd, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. public void onCreate(SQLiteDatabase db) {
  2. String queryR = "SELECT intR FROM colors";
  3. String queryG = "SELECT intG FROM colors";
  4. String queryB = "SELECT intB FROM colors";
  5.  
  6. int[] R = null;
  7. int[] G = null;
  8. int[] B = null;
  9.  
  10. try {
  11. Cursor cursor = db.rawQuery(queryR,null);
  12. if (cursor != null) {
  13. for( int i = 0;i < cursor.getCount(); i++) {
  14. R[i] = cursor.getInt(cursor.getColumnIndex("intR"));
  15. }
  16. for( int i = 0; i < cursor.getCount(); i++) {
  17. G[i] = cursor.getInt(cursor.getColumnIndex("intG"));
  18. }
  19. for( int i = 0; i < cursor.getCount(); i++) {
  20. B[i] = cursor.getInt(cursor.getColumnIndex("intB"));
  21. }
  22. }
  23. } catch (NumberFormatException e) { throw new Error("777"); }
  24.  
  25. }
Add Comment
Please, Sign In to add comment