コード例 #1
0
 public void insertGravitySettingInfo(GravitySettingInfo info) {
   final DataProvider dataProvider = mDataProvider;
   ContentValues values = new ContentValues();
   info.contentValues(values);
   dataProvider.insertGravitySetting(values);
   values = null;
 }
コード例 #2
0
 // 重力感应设置
 public GravitySettingInfo getGravitySettingInfo() {
   final DataProvider dataProvider = mDataProvider;
   Cursor cursor = dataProvider.queryGravitySetting();
   if (null != cursor) {
     try {
       GravitySettingInfo info = new GravitySettingInfo();
       boolean bOk = info.parseFromCursor(cursor);
       if (bOk) {
         return info;
       }
     } catch (SQLiteException e) {
       e.printStackTrace();
     } finally {
       cursor.close();
     }
   }
   return null;
 }