Yuvipanda has uploaded a new change for review.
https://gerrit.wikimedia.org/r/125975
Change subject: Fix keyboard not hiding when it should
......................................................................
Fix keyboard not hiding when it should
Bug: 63493
Change-Id: I8e9c59bc4d37092a4035c661e559700e64e48d82
---
M wikipedia/src/main/java/org/wikipedia/Utils.java
1 file changed, 7 insertions(+), 5 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia
refs/changes/75/125975/1
diff --git a/wikipedia/src/main/java/org/wikipedia/Utils.java
b/wikipedia/src/main/java/org/wikipedia/Utils.java
index 4409be1..bec0eca 100644
--- a/wikipedia/src/main/java/org/wikipedia/Utils.java
+++ b/wikipedia/src/main/java/org/wikipedia/Utils.java
@@ -204,15 +204,17 @@
}
/**
- * Attempt to hide the Android Keyboard
+ * Attempt to hide the Android Keyboard.
+ *
+ * FIXME: This should not need to exist.
+ * I do not know why Android does not handle this automatically.
*
* @param activity The current activity
*/
public static void hideSoftKeyboard(Activity activity) {
- if (activity.getCurrentFocus() != null) {
- InputMethodManager keyboard =
(InputMethodManager)activity.getSystemService(Context.INPUT_METHOD_SERVICE);
-
keyboard.hideSoftInputFromWindow(activity.getCurrentFocus().getWindowToken(),
0);
- }
+ InputMethodManager keyboard =
(InputMethodManager)activity.getSystemService(Context.INPUT_METHOD_SERVICE);
+ // Not using getCurrentFocus as that sometimes is null, but the
keyboard is still up.
+
keyboard.hideSoftInputFromWindow(activity.getWindow().getDecorView().getWindowToken(),
0);
}
public static void setupShowPasswordCheck(final CheckBox check, final
EditText edit) {
--
To view, visit https://gerrit.wikimedia.org/r/125975
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I8e9c59bc4d37092a4035c661e559700e64e48d82
Gerrit-PatchSet: 1
Gerrit-Project: apps/android/wikipedia
Gerrit-Branch: master
Gerrit-Owner: Yuvipanda <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits