Crash app when sendkey Enter

Appium: 1.6.3
Devices test: Android
Executing environment: Windows and Mac

Reproduce:

I input on search field and press button Enter. But, it usually abandons application immediately.
I’v used adb to press Enter, method pressKeyCode(66), just added \n in last letter, input letter and waited about 10 second, or after input letter pressed Esc and focused again that field then press enter. It means, I’ve tried a lot of way to resolve this problem. But it seem like not work for me anymore.
Press Enter by hand while using Appium (go to Setting to reopen keyboard and press Search button)
or use adb to press Enter (not use Appium) it still works OK.

Funny thing is, when I append space letter in search text. I worked for me about 10 times. After that, It still crash
Could you guy help me to resolved this problem, it’s very importance to me

Log from android device when clicked on Enter button.

I/Input   (19434): injectKeyEvent: KeyEvent { action=ACTION_DOWN, keyCode=KEYCODE_ENTER, scanCode=0, metaState=0, flags=0x0, repeatCount=0, eventTime=71030605, downTime=71030605, deviceId=-1, source=0x101 }
I/AppiumUnicodeIME( 1838): onKeyDown (keyCode='66', event.keyCode='66', metaState='0')
I/Input   (19434): injectKeyEvent: KeyEvent { action=ACTION_UP, keyCode=KEYCODE_ENTER, scanCode=0, metaState=0, flags=0x0, repeatCount=0, eventTime=71030605, downTime=71030605, deviceId=-1, source=0x101 }
I/AppiumUnicodeIME( 1838): onKeyUp (keyCode='66', event.keyCode='66', metaState='0')
E/InputEventSender(19085): Exception dispatching finished signal.
E/MessageQueue-JNI(19085): Exception in MessageQueue callback: handleReceiveCallback
V/HttpClient(19085): try http request to https://XXX-XXX.XXXX.XX/api/v2/search?accessToken=TOKEN_HERE=1&keyword=longnguyen94+ requestBody : null
E/MessageQueue-JNI(19085): java.lang.NullPointerException: Attempt to invoke virtual method 'int java.util.ArrayList.size()' on a null object reference
E/MessageQueue-JNI(19085):      at XX.XXXX.XXXXX.fragment.SearchFragment.saveSearchHistory(SearchFragment.java:1066)
E/MessageQueue-JNI(19085):      at XX.XXXX.XXXXX.fragment.SearchFragment.access$300(SearchFragment.java:74)
E/MessageQueue-JNI(19085):      at XX.XXXX.XXXXX.fragment.SearchFragment$2.onQueryTextSubmit(SearchFragment.java:391)
E/MessageQueue-JNI(19085):      at android.support.v7.widget.SearchView.onSubmitQuery(SearchView.java:1158)
E/MessageQueue-JNI(19085):      at android.support.v7.widget.SearchView.access$900(SearchView.java:103)
E/MessageQueue-JNI(19085):      at android.support.v7.widget.SearchView$9.onEditorAction(SearchView.java:1136)
E/MessageQueue-JNI(19085):      at android.widget.TextView.onKeyUp(TextView.java:5992)
E/MessageQueue-JNI(19085):      at android.widget.AutoCompleteTextView.onKeyUp(AutoCompleteTextView.java:696)
E/MessageQueue-JNI(19085):      at android.view.KeyEvent.dispatch(KeyEvent.java:2633)
E/MessageQueue-JNI(19085):      at android.view.View.dispatchKeyEvent(View.java:8401)
E/MessageQueue-JNI(19085):      at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1601)
E/MessageQueue-JNI(19085):      at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1601)
E/MessageQueue-JNI(19085):      at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1601)
E/MessageQueue-JNI(19085):      at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1601)
E/MessageQueue-JNI(19085):      at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1601)
E/MessageQueue-JNI(19085):      at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1601)
E/MessageQueue-JNI(19085):      at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1601)
E/MessageQueue-JNI(19085):      at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1601)
E/MessageQueue-JNI(19085):      at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1601)
E/MessageQueue-JNI(19085):      at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1601)
E/MessageQueue-JNI(19085):      at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1601)
E/MessageQueue-JNI(19085):      at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1601)
E/MessageQueue-JNI(19085):      at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchKeyEvent(PhoneWindow.java:2321)
E/MessageQueue-JNI(19085):      at com.android.internal.policy.impl.PhoneWindow.superDispatchKeyEvent(PhoneWindow.java:1694)
E/MessageQueue-JNI(19085):      at android.app.Activity.dispatchKeyEvent(Activity.java:2729)
E/MessageQueue-JNI(19085):      at android.support.v7.app.AppCompatActivity.dispatchKeyEvent(AppCompatActivity.java:513)
E/MessageQueue-JNI(19085):      at android.support.v7.view.WindowCallbackWrapper.dispatchKeyEvent(WindowCallbackWrapper.java:50)
E/MessageQueue-JNI(19085):      at android.support.v7.app.AppCompatDelegateImplBase$AppCompatWindowCallbackBase.dispatchKeyEvent(AppCompatDelegateImplBase.java:241)
E/MessageQueue-JNI(19085):      at android.support.v7.view.WindowCallbackWrapper.dispatchKeyEvent(WindowCallbackWrapper.java:50)
E/MessageQueue-JNI(19085):      at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchKeyEvent(PhoneWindow.java:2236)
E/MessageQueue-JNI(19085):      at android.view.ViewRootImpl$ViewPostImeInputStage.processKeyEvent(ViewRootImpl.java:3984)
E/MessageQueue-JNI(19085):      at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:3946)
E/MessageQueue-JNI(19085):      at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3515)
E/MessageQueue-JNI(19085):      at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3568)
E/MessageQueue-JNI(19085):      at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3534)
E/MessageQueue-JNI(19085):      at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:3644)
E/MessageQueue-JNI(19085):      at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3542)
E/MessageQueue-JNI(19085):      at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:3701)
E/MessageQueue-JNI(19085):      at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3515)
E/MessageQueue-JNI(19085):      at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3568)
E/MessageQueue-JNI(19085):      at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3534)
E/MessageQueue-JNI(19085):      at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3542)
E/MessageQueue-JNI(19085):      at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3515)
E/MessageQueue-JNI(19085):      at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3568)
E/MessageQueue-JNI(19085):      at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3534)
E/MessageQueue-JNI(19085):      at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:3677)
E/MessageQueue-JNI(19085):      at android.view.ViewRootImpl$ImeInputStage.onFinishedInputEvent(ViewRootImpl.java:3838)
E/MessageQueue-JNI(19085):      at android.view.inputmethod.InputMethodManager$PendingEvent.run(InputMethodManager.java:2289)
E/MessageQueue-JNI(19085):      at android.view.inputmethod.InputMethodManager.invokeFinishedInputEventCallback(InputMethodManager.java:1880)
E/MessageQueue-JNI(19085):      at android.view.inputmethod.InputMethodManager.finishedInputEvent(InputMethodManager.java:1871)
E/MessageQueue-JNI(19085):      at android
V/HttpClient(19085): header : []
E/AndroidRuntime(19085): FATAL EXCEPTION: main
E/AndroidRuntime(19085): Process: XX.XXXX.XXXXXX, PID: 19085
E/AndroidRuntime(19085): java.lang.NullPointerException: Attempt to invoke virtual method 'int java.util.ArrayList.size()' on a null object reference
E/AndroidRuntime(19085):        at mu.eggs.recochoku.fragment.SearchFragment.saveSearchHistory(SearchFragment.java:1066)
E/AndroidRuntime(19085):        at mu.eggs.recochoku.fragment.SearchFragment.access$300(SearchFragment.java:74)
E/AndroidRuntime(19085):        at mu.eggs.recochoku.fragment.SearchFragment$2.onQueryTextSubmit(SearchFragment.java:391)
E/AndroidRuntime(19085):        at android.support.v7.widget.SearchView.onSubmitQuery(SearchView.java:1158)
E/AndroidRuntime(19085):        at android.support.v7.widget.SearchView.access$900(SearchView.java:103)
E/AndroidRuntime(19085):        at android.support.v7.widget.SearchView$9.onEditorAction(SearchView.java:1136)
E/AndroidRuntime(19085):        at android.widget.TextView.onKeyUp(TextView.java:5992)
E/AndroidRuntime(19085):        at android.widget.AutoCompleteTextView.onKeyUp(AutoCompleteTextView.java:696)
E/AndroidRuntime(19085):        at android.view.KeyEvent.dispatch(KeyEvent.java:2633)
E/AndroidRuntime(19085):        at android.view.View.dispatchKeyEvent(View.java:8401)
E/AndroidRuntime(19085):        at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1601)
E/AndroidRuntime(19085):        at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1601)
E/AndroidRuntime(19085):        at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1601)
E/AndroidRuntime(19085):        at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1601)
E/AndroidRuntime(19085):        at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1601)
E/AndroidRuntime(19085):        at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1601)
E/AndroidRuntime(19085):        at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1601)
E/AndroidRuntime(19085):        at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1601)
E/AndroidRuntime(19085):        at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1601)
E/AndroidRuntime(19085):        at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1601)
E/AndroidRuntime(19085):        at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1601)
E/AndroidRuntime(19085):        at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1601)
E/AndroidRuntime(19085):        at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchKeyEvent(PhoneWindow.java:2321)
E/AndroidRuntime(19085):        at com.android.internal.policy.impl.PhoneWindow.superDispatchKeyEvent(PhoneWindow.java:1694)
E/AndroidRuntime(19085):        at android.app.Activity.dispatchKeyEvent(Activity.java:2729)
E/AndroidRuntime(19085):        at android.support.v7.app.AppCompatActivity.dispatchKeyEvent(AppCompatActivity.java:513)
E/AndroidRuntime(19085):        at android.support.v7.view.WindowCallbackWrapper.dispatchKeyEvent(WindowCallbackWrapper.java:50)
E/AndroidRuntime(19085):        at android.support.v7.app.AppCompatDelegateImplBase$AppCompatWindowCallbackBase.dispatchKeyEvent(AppCompatDelegateImplBase.java:241)
E/AndroidRuntime(19085):        at android.support.v7.view.WindowCallbackWrapper.dispatchKeyEvent(WindowCallbackWrapper.java:50)
E/AndroidRuntime(19085):        at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchKeyEvent(PhoneWindow.java:2236)
E/AndroidRuntime(19085):        at android.view.ViewRootImpl$ViewPostImeInputStage.processKeyEvent(ViewRootImpl.java:3984)
E/AndroidRuntime(19085):        at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:3946)
E/AndroidRuntime(19085):        at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3515)
E/AndroidRuntime(19085):        at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3568)
E/AndroidRuntime(19085):        at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3534)
E/AndroidRuntime(19085):        at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:3644)
E/AndroidRuntime(19085):        at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3542)
E/AndroidRuntime(19085):        at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:3701)
E/AndroidRuntime(19085):        at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3515)
E/AndroidRuntime(19085):        at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3568)
E/AndroidRuntime(19085):        at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3534)
E/AndroidRuntime(19085):        at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3542)
E/AndroidRuntime(19085):        at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3515)
E/AndroidRuntime(19085):        at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3568)
E/AndroidRuntime(19085):        at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3534)
E/AndroidRuntime(19085):        at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:3677)
E/AndroidRuntime(19085):        at android.view.ViewRootImpl$ImeInputStage.onFinishedInputEvent(ViewRootImpl.java:3838)
E/AndroidRuntime(19085):        at android.view.inputmethod.InputMethodManager$PendingEvent.run(InputMethodManager.java:2289)
E/AndroidRuntime(19085):        at android.view.inputmethod.InputMethodManager.invokeFinishedInputEventCallback(InputMethodManager.java:1880)
E/AndroidRuntime(19085):        at android.view.inputmethod.InputMethodManager.f
W/ActivityManager( 1124): Process XX.XXXX.XXXXXXXX has crashed too many times: killing!
W/ActivityManager( 1124):   Force finishing activity XX.XXXX.XXXXXXXX/.activity.MainActivity
W/ActivityManager( 1124): Wtf, activity ActivityRecord{28c973f3 u0 mu.eggs.recochoku/.activity.MainActivity t807 f} in proc activity list not using proc ProcessRecord{2551f21f 19085:XX.XXXX.XXXXXXXX/u0a239}?!?
I