Buggy code:
public class QuestionDetailsActivity extends ToolbarActivity implements IAuthTokenGetter , OnCommentEventCallback , OnMoreCommentsRequestedCallback , OnQuestionEventCallback { private QuestionDetailsActivity . RetrieveEntryTask retrieveEntryTask ; private QuestionView questionView ; private RecyclerView commentsView ; private EditText commentEdit ; private CheckBox anonymityCheckBox ; private CommentsListAdapter adapter ; private static final int COMMENTS_LIMIT = 15 ; private int commentsOffset = 0 ; private boolean forceRefresh = false ; private int remaining = Integer . MAX_VALUE ; private CallbacksKeeper callbacksKeeper = new CallbacksKeeper ( ) ; private ServiceHelper serviceHelper ; private LoaderManager . LoaderCallbacks < Cursor > commentsLoaderCallbacks = new QuestionDetailsActivity . CommentsLoaderCallbacksImpl ( ) ; public static final class BundleKeys { public static final String PENDING_OPERATIONS = "PENDING_OPERATIONS" ; public static final String COMMENTS_OFFSET = "COMMENTS_OFFSET" ; public static final String REMAINING = "REMAINING" ; } public static final class IntentExtras { public static final String Q_ID = "qid" ; public static final String COMMENT_ID = "COMMENT_ID" ; public static final String FORCE_REFRESH = "FORCE_REFRESH" ; public static final String AFTER_CREATE = "AFTER_CREATE" ; public static final String ENTRY_POSITION = "ENTRY_POSITION" ; } @ Override public AccountManagerFuture < Bundle > getAuthToken ( AccountManagerCallback < Bundle > cb ) { } @ Override public AccountManagerFuture < Bundle > getAuthTokenOrExit ( final AccountManagerCallback < Bundle > cb ) { } @ Override protected void onCreate ( Bundle savedInstanceState ) { } @ Override public void onSaveInstanceState ( Bundle outState ) { } @ Override public void onResume ( ) { } @ Override public void onPause ( ) { } @ Override public void onBackPressed ( ) { boolean afterCreate = getIntent ( ) . getBooleanExtra ( QuestionDetailsActivity . IntentExtras . AFTER_CREATE , false ) ; if ( afterCreate ) { Intent data = new Intent ( ) ; data . putExtra ( QuestionDetailsActivity . IntentExtras . ENTRY_POSITION , afterCreate ) ; <START_BUG> setResult ( RESULT_OK ) ; <END_BUG> finish ( ) ; } else { Intent data = new Intent ( ) ; int entryPosition = getIntent ( ) . getIntExtra ( QuestionDetailsActivity . IntentExtras . ENTRY_POSITION , ( - 1 ) ) ; data . putExtra ( QuestionDetailsActivity . IntentExtras . ENTRY_POSITION , entryPosition ) ; setResult ( RESULT_OK , data ) ; finish ( ) ; } } private void sendComment ( ) { } @ Override public void moreCommentsRequested ( ) { } @ Override public void onLikeClick ( int entryPosition , QuestionEntry post ) { } @ Override public void onVoteClick ( int entryPosition , QuestionEntry post , int voteId ) { } @ Override public void onCommentsClick ( int entryPosition , QuestionEntry post ) { } @ Override public void onReportSpam ( int entryPosition , QuestionEntry post ) { } @ Override public void onReportSpam ( int entryPosition , CommentEntry entry ) { } class RetrieveEntryTask extends AsyncTask < Void , Void , QuestionEntry > { @ Override protected QuestionEntry doInBackground ( Void ... params ) { } @ Override protected void onPostExecute ( QuestionEntry entry ) { } } class QuestionUpdateTask extends AsyncTask < Void , Void , QuestionEntry > { @ Override protected QuestionEntry doInBackground ( Void ... params ) { } @ Override protected void onPostExecute ( QuestionEntry entry ) { } } private class CommentsLoaderCallbacksImpl implements LoaderManager . LoaderCallbacks < Cursor > { @ Override public Loader < Cursor > onCreateLoader ( int id , Bundle args ) { } @ Override public void onLoadFinished ( Loader < Cursor > loader , Cursor newCursor ) { } @ Override public void onLoaderReset ( Loader < Cursor > loader ) { } } }

Fix:
setResult ( RESULT_OK , data ) ;