Code example for ExecutorService

Methods: execute

0
  private          long                    verificationStartTime;
 
  @Override 
  public int onStartCommand(final Intent intent, int flags, int startId) {
    if (intent != null && intent.getAction().equals(REGISTER_NUMBER_ACTION)) {
      executor.execute(new Runnable() {
        @Override 
        public void run() { 
          handleRegistrationIntent(intent);
        } 
      }); 
    } 
 
    return START_NOT_STICKY;
  } 
 
  @Override 
  public void onDestroy() { 
    super.onDestroy(); 
    executor.shutdown();
    shutdown();