diff options
| author | James Cook <jamescook@google.com> | 2015-06-02 13:27:28 -0700 |
|---|---|---|
| committer | James Cook <jamescook@google.com> | 2015-06-02 16:02:12 -0700 |
| commit | d8b7d2ce2da68cd1853dd1d734eae6fb9f6323d4 (patch) | |
| tree | a74c3922d882ed959936fc5fd952ea78db2e5751 /core/java/android/widget/TabHost.java | |
| parent | ce48c1c1d8033e0bb62e0b24645b5c600c4adfc6 (diff) | |
Fix TabHost stealing focus on hardware keyboard keypress
Don't try to change focus at all on exit from touch mode. The old
behavior might have been useful for very old apps with a TabHost as
their primary UI, but that's not a modern app structure.
Bug: 21417491
Change-Id: I3db2ab42c90b6c82f23216244a8183c4290eb7d7
Diffstat (limited to 'core/java/android/widget/TabHost.java')
| -rw-r--r-- | core/java/android/widget/TabHost.java | 25 |
1 files changed, 1 insertions, 24 deletions
diff --git a/core/java/android/widget/TabHost.java b/core/java/android/widget/TabHost.java index c521f72d7ad0..27fa3b91dfe8 100644 --- a/core/java/android/widget/TabHost.java +++ b/core/java/android/widget/TabHost.java @@ -188,32 +188,9 @@ mTabHost.addTab(TAB_TAG_1, "Hello, world!", "Tab 1"); mLocalActivityManager = activityGroup; } - - @Override - protected void onAttachedToWindow() { - super.onAttachedToWindow(); - final ViewTreeObserver treeObserver = getViewTreeObserver(); - treeObserver.addOnTouchModeChangeListener(this); - } - @Override - protected void onDetachedFromWindow() { - super.onDetachedFromWindow(); - final ViewTreeObserver treeObserver = getViewTreeObserver(); - treeObserver.removeOnTouchModeChangeListener(this); - } - - /** - * {@inheritDoc} - */ public void onTouchModeChanged(boolean isInTouchMode) { - if (!isInTouchMode) { - // leaving touch mode.. if nothing has focus, let's give it to - // the indicator of the current tab - if (mCurrentView != null && (!mCurrentView.hasFocus() || mCurrentView.isFocused())) { - mTabWidget.getChildTabViewAt(mCurrentTab).requestFocus(); - } - } + // No longer used, but kept to maintain API compatibility. } /** |
