File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
examples/demo-apps/android/LlamaDemo/app/src/main/java/com/example/executorchllamademo Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change 2626import android .system .Os ;
2727import android .util .Log ;
2828import android .view .View ;
29+ import android .view .inputmethod .InputMethodManager ;
2930import android .widget .EditText ;
3031import android .widget .ImageButton ;
3132import android .widget .ImageView ;
@@ -662,6 +663,12 @@ private void onModelRunStopped() {
662663 mSendButton .setImageResource (R .drawable .baseline_send_24 );
663664 mSendButton .setOnClickListener (
664665 view -> {
666+ try {
667+ InputMethodManager imm = (InputMethodManager ) getSystemService (INPUT_METHOD_SERVICE );
668+ imm .hideSoftInputFromWindow (getCurrentFocus ().getWindowToken (), 0 );
669+ } catch (Exception e ) {
670+ ETLogging .getInstance ().log ("Keyboard dismissal error: " + e .getMessage ());
671+ }
665672 addSelectedImagesToChatThread (mSelectedImageUri );
666673 String finalPrompt ;
667674 String rawPrompt = mEditTextMessage .getText ().toString ();
You can’t perform that action at this time.
0 commit comments