Code example for Activity

Methods: finish

0
    @Override 
    protected Object doInBackground(Object... objects) {
      try { 
        Thread.sleep(INACTIVITY_DELAY_MS);
        Log.i(TAG, "Finishing activity due to inactivity");
        activity.finish();
      } catch (InterruptedException e) {
        // continue without killing 
      } 
      return null; 
    } 
  } 
 
}