@Override public void onCreate() { if (Constant.DEBUG) Log.v(TAG, ">>> onCreate"); super.onCreate(); command = new Runnable() { @Override public void run() { if (Constant.DEBUG) Log.d(TAG, ">>> run()"); MemUtilizationLog memUtilizationLog = getMemUtilization(); long nowTime = System.currentTimeMillis(); ContentValues contentValues = new ContentValues(); contentValues.put( MemUtilizationLogProvider.COLUMN_NAME.YYYYMMDD, yyyymmddFormat.format(nowTime)); contentValues.put( MemUtilizationLogProvider.COLUMN_NAME.TOTAL, memUtilizationLog.getTotal()); contentValues.put( MemUtilizationLogProvider.COLUMN_NAME.FREE, memUtilizationLog.getFree()); contentValues.put( MemUtilizationLogProvider.COLUMN_NAME.CACHE, memUtilizationLog.getCached()); contentValues.put(MemUtilizationLogProvider.COLUMN_NAME.CREATED_ON_LONG, nowTime); contentValues.put( MemUtilizationLogProvider.COLUMN_NAME.CREATED_ON, dateFormat.format(nowTime)); getContentResolver().insert(MemUtilizationLogProvider.CONTENT_URI, contentValues); if (Constant.DEBUG) Log.d(TAG, "<<< run()"); waitSeconds(2); stopSelf(); } }; doExecute(command); if (Constant.DEBUG) Log.v(TAG, "<<< onCreate"); }
@Override public void onDestroy() { if (Constant.DEBUG) Log.v(TAG, ">>> onDestroy"); super.onDestroy(); if (Constant.DEBUG) Log.v(TAG, "<<< onDestroy"); }
public void onStart(Intent intent, int startId) { if (Constant.DEBUG) Log.v(TAG, ">>> onStart"); super.onStart(intent, startId); if (Constant.DEBUG) Log.v(TAG, "<<< onStart"); }