Buggy code:
public class EditTextPresenterImpl implements IEditTextPresenter , PermissionUtils . OnPermissionCallBacks { private static final String TAG = EditTextPresenterImpl . class . getSimpleName ( ) ; private Context mContext ; private Activity mActivity ; private RxPhotoNote mRxPhotoNote ; private RxUser mRxUser ; private IEditTextView mEditTextView ; private int mCategoryId ; private int mPosition ; private int mComparator ; private Handler mHandler ; private SpeechRecognizer mIat ; private HashMap < String , String > mIatResults ; private String mContentString = null ; int ret = 0 ; private boolean mIsFinishing = false ; private long mLastTime = 0L ; private boolean mIsVoiceOpen = false ; @ Inject public EditTextPresenterImpl ( @ ContextLife ( "Activity" ) Context context , Activity activity , RxPhotoNote rxPhotoNote , RxUser rxUser ) { } @ Override public void attachView ( IView iView ) { } @ Override public void bindData ( int categoryId , int position , int comparator ) { } @ Override public void saveText ( ) { } @ Override public void update2Evernote ( ) { mRxUser . isLoginEvernote ( ) . observeOn ( AndroidSchedulers . mainThread ( ) ) . subscribe ( ( aBoolean ) -> { if ( aBoolean ) { <START_BUG> mRxPhotoNote . findByCategoryId ( mCategoryId , mComparator ) . map ( ( photoNoteList ) -> photoNoteList . get ( mPosition ) ) . doOnSubscribe ( ( ) -> mEditTextView . showProgressBar ( ) ) . map ( ( photoNote1 ) -> doUpdate2Evernote ( photoNote1 . getBigPhotoPathWithoutFile ( ) , photoNote1 . getPhotoName ( ) ) ) . subscribeOn ( AndroidSchedulers . mainThread ( ) ) . subscribe ( ( aBoolean1 ) -> { <END_BUG> if ( aBoolean1 ) { mEditTextView . showSnakeBar ( mContext . getResources ( ) . getString ( R . string . toast_success ) ) ; } else { mEditTextView . showSnakeBar ( mContext . getResources ( ) . getString ( R . string . toast_fail ) ) ; } mEditTextView . hideProgressBar ( ) ; } ) ; } else { mEditTextView . showSnakeBar ( mContext . getResources ( ) . getString ( R . string . not_login ) ) ; } } ) ; } @ Override public void finishActivity ( boolean saved ) { } @ Override public void startVoice ( ) { } @ Permission ( PermissionUtils . CODE_AUDIO ) private void doVoiceInput ( ) { } @ Override public void stopVoice ( ) { } @ Override public void onBackPressEvent ( ) { } private InitListener mInitListener = new InitListener ( ) { @ Override public void onInit ( int code ) { } } ; private RecognizerListener mRecognizerListener = new RecognizerListener ( ) { @ Override public void onBeginOfSpeech ( ) { } @ Override public void onError ( SpeechError error ) { } @ Override public void onEndOfSpeech ( ) { } @ Override public void onResult ( RecognizerResult results , boolean isLast ) { } @ Override public void onVolumeChanged ( int volume , byte [ ] data ) { } @ Override public void onEvent ( int eventType , int arg1 , int arg2 , Bundle obj ) { } private String getResultString ( RecognizerResult results ) { } private String parseIatResult ( String json ) { } } ; @ Override public void detachView ( ) { } private boolean doUpdate2Evernote ( String bigPhotoPathWithoutFile , String photoName ) { } public void setVoiceParam ( ) { } @ Override public void onPermissionsGranted ( List < String > permissions ) { } @ Override public void onPermissionsDenied ( List < String > permissions ) { } @ Override public void onRequestPermissionsResult ( int requestCode , @ NonNull String [ ] permissions , @ NonNull int [ ] grantResults ) { } }

Fix:
mRxPhotoNote . findByCategoryId ( mCategoryId , mComparator ) . map ( ( photoNoteList ) -> photoNoteList . get ( mPosition ) ) . doOnSubscribe ( ( ) -> mEditTextView . showProgressBar ( ) ) . map ( ( photoNote1 ) -> doUpdate2Evernote ( photoNote1 . getBigPhotoPathWithoutFile ( ) , photoNote1 . getPhotoName ( ) ) ) . observeOn ( AndroidSchedulers . mainThread ( ) ) . subscribe ( ( aBoolean1 ) -> {