@Override
    protected void onStop() {
        super.onStop();
        // Stop logging to UI when this activity is stopped.
        stopLogging();

        Log.d(mLogTag, "onStop");
    }
Activity that logs all key lifecycle callbacks to {@link Log}.
Output is also logged to the UI into a {@link LogFragment} through {@link #initializeLogging()}
and {@link #stopLogging()}.
MultiWindowPlayground/Application/src/main/java/com/android/multiwindowplayground/activities/LoggingActivity.java