Exemple #1
0
 public Skin getSkin(int cid, int num) {
   DatabaseOpenHelper.SkinCursor cursor = sHelper.querySkin(cid, num);
   if (cursor.moveToFirst()) {
     if (DEBUG) Log.i(TAG, "查询单个皮肤:cid=" + cid + "num:" + num);
     return cursor.getSkin();
   }
   return null;
 }
Exemple #2
0
 @Override
 public Skin get(int sid) {
   DatabaseOpenHelper.SkinCursor cursor = sHelper.querySkin(sid);
   if (cursor.moveToFirst()) {
     return cursor.getSkin();
   }
   return null;
 }
Exemple #3
0
  public static ArrayList<Skin> cursorToArrayList(DatabaseOpenHelper.SkinCursor cursor) {
    ArrayList<Skin> skins = null;
    if (cursor != null && cursor.moveToFirst()) {
      skins = new ArrayList<>();
      do {
        skins.add(cursor.getSkin());
      } while (cursor.moveToNext());

      cursor.close();
    }
    return skins;
  }