question: private void saveAndClose ( boolean save ) { content . setEnabled ( false ) ; if ( timer != null ) { timer . cancel ( ) ; timer = null ; } if ( timerNextSync != null ) { timerNextSync . cancel ( ) ; timerNextSync = null ; } if ( save ) { Log . d ( LOG_TAG , "saveAndClose with SAVE" ) ; saveData ( null ) ; } else { Log . d ( LOG_TAG , "saveAndClose WITHOUT save" ) ; } Intent data = new Intent ( ) ; data . setAction ( Intent . ACTION_VIEW ) ; data . putExtra ( PARAM_NOTE , note ) ; data . putExtra ( PARAM_NOTE_POSITION , notePosition ) ; setResult ( RESULT_OK , data ) ; finish ( ) ; }
target:  Saves all changes and closes the Activity