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 26
26
import android .system .Os ;
27
27
import android .util .Log ;
28
28
import android .view .View ;
29
+ import android .view .inputmethod .InputMethodManager ;
29
30
import android .widget .EditText ;
30
31
import android .widget .ImageButton ;
31
32
import android .widget .ImageView ;
@@ -662,6 +663,12 @@ private void onModelRunStopped() {
662
663
mSendButton .setImageResource (R .drawable .baseline_send_24 );
663
664
mSendButton .setOnClickListener (
664
665
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
+ }
665
672
addSelectedImagesToChatThread (mSelectedImageUri );
666
673
String finalPrompt ;
667
674
String rawPrompt = mEditTextMessage .getText ().toString ();
You can’t perform that action at this time.
0 commit comments