From 3d95ac1f938e017a8e47328db77d8440c66c2f47 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sat, 7 Feb 2015 13:42:49 -0500 Subject: [PATCH] Fix keyboard dismissal on Fire TV devices --- .../com/limelight/preferences/AddComputerManually.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/src/main/java/com/limelight/preferences/AddComputerManually.java b/app/src/main/java/com/limelight/preferences/AddComputerManually.java index c484df75..cbbc8786 100644 --- a/app/src/main/java/com/limelight/preferences/AddComputerManually.java +++ b/app/src/main/java/com/limelight/preferences/AddComputerManually.java @@ -14,6 +14,7 @@ import com.limelight.utils.UiHelper; import android.app.Activity; import android.app.Service; import android.content.ComponentName; +import android.content.Context; import android.content.Intent; import android.content.ServiceConnection; import android.content.res.Configuration; @@ -21,6 +22,7 @@ import android.os.Bundle; import android.os.IBinder; import android.view.KeyEvent; import android.view.inputmethod.EditorInfo; +import android.view.inputmethod.InputMethodManager; import android.widget.TextView; import android.widget.Toast; @@ -161,6 +163,12 @@ public class AddComputerManually extends Activity { computersToAdd.add(hostText.getText().toString().trim()); } + else if (actionId == EditorInfo.IME_ACTION_PREVIOUS) { + // This is how the Fire TV dismisses the keyboard + InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE); + imm.hideSoftInputFromWindow(hostText.getWindowToken(), 0); + return false; + } return false; }