Merge "Fix OutOfBounds issue on getFocusedChild" into ub-launcher3-master
diff --git a/src/com/android/launcher3/allapps/AlphabeticalAppsList.java b/src/com/android/launcher3/allapps/AlphabeticalAppsList.java
index 354f97c..f235199 100644
--- a/src/com/android/launcher3/allapps/AlphabeticalAppsList.java
+++ b/src/com/android/launcher3/allapps/AlphabeticalAppsList.java
@@ -132,7 +132,7 @@
* Returns the child adapter item with IME launch focus.
*/
public AdapterItem getFocusedChild() {
- if (mAdapterItems.size() == 0) {
+ if (mAdapterItems.size() == 0 || getFocusedChildIndex() != -1) {
return null;
}
return mAdapterItems.get(getFocusedChildIndex());