@Override
  public void onDestroy() {
    super.onDestroy();

    // 取消掉所有的回调
    mCallbacks.kill();
  }
Example #2
0
  @Override
  public void onDestroy() {
    super.onDestroy();

    ((AlarmManager) getSystemService(Context.ALARM_SERVICE)).cancel(mPAlarmIntent);
    mRosterCallbacks.kill();
    performDisconnect();
    unregisterReceiver(mAlarmReceiver);
  }
  @Override
  public void onDestroy() {
    // Cancel the persistent notification.
    mNM.cancel(R.string.remote_service_started);

    // Tell the user we stopped.
    Toast.makeText(this, R.string.remote_service_stopped, Toast.LENGTH_SHORT).show();

    // Unregister all callbacks.
    mCallbacks.kill();

    // Remove the next pending message to increment the counter, stopping
    // the increment loop.
    mHandler.removeMessages(REPORT_MSG);
  }
 @Override
 public void destroy() {
   final Looper looper = mainWorker.getLooper();
   if (looper != null) {
     looper.quit();
   }
   apiCallbacks.kill();
   mainHandler = null;
   mainWorker = null;
   appService = null;
   if (DEBUG) {
     Log.d(TAG, "API methods destroyed");
   }
   System.gc();
 }
  @Override
  public void onDestroy() {
    // Cancel the persistent notification.
    if (mNM != null) mNM.cancel(R.string.remote_service_started);

    if (mLocationListener != null) getLocationManager().removeUpdates(mLocationListener);

    if (db != null) db.close();

    // Tell the user we stopped.
    // Toast.makeText(this, R.string.remote_service_stopped, Toast.LENGTH_SHORT).show();

    // Unregister all callbacks.
    if (mCallbacks != null) mCallbacks.kill();

    // Remove the next pending message to increment the counter, stopping
    // the increment loop.
    // mHandler.removeMessages(REPORT_MSG);
  }
Example #6
0
 @Override
 public void onDestroy() {
   // disconnect();  // TODO
   callbackList.kill(); // unregister all callbacks
   super.onDestroy();
 }