diff options
| author | Ben Komalo <benkomalo@google.com> | 2010-11-01 12:24:16 -0700 |
|---|---|---|
| committer | Ben Komalo <benkomalo@google.com> | 2010-11-03 12:05:49 -0700 |
| commit | ad199ecc441649f0ad816f7b139ab5ddffad98dd (patch) | |
| tree | 07f00b449cc78e729fa77781d03bf442d96620ca /core | |
| parent | e0c0504c7ea508b89329d4492dea9cd97c88af42 (diff) | |
| download | frameworks_base-ad199ecc441649f0ad816f7b139ab5ddffad98dd.zip frameworks_base-ad199ecc441649f0ad816f7b139ab5ddffad98dd.tar.gz frameworks_base-ad199ecc441649f0ad816f7b139ab5ddffad98dd.tar.bz2 | |
Fix issue where home layout click listener was being attached
before it was initialized.
Change-Id: I25641ca7c2db18d423dcafebc9bdf42d608a7a31
Diffstat (limited to 'core')
| -rw-r--r-- | core/java/com/android/internal/widget/ActionBarView.java | 29 |
1 files changed, 12 insertions, 17 deletions
diff --git a/core/java/com/android/internal/widget/ActionBarView.java b/core/java/com/android/internal/widget/ActionBarView.java index 15d42cb..95d6dd3 100644 --- a/core/java/com/android/internal/widget/ActionBarView.java +++ b/core/java/com/android/internal/widget/ActionBarView.java @@ -123,8 +123,6 @@ public class ActionBarView extends ViewGroup { } }; - private OnClickListener mHomeClickListener = null; - private OnClickListener mTabClickListener = null; public ActionBarView(Context context, AttributeSet attrs) { @@ -169,9 +167,6 @@ public class ActionBarView extends ViewGroup { mHomeLayout = new LinearLayout(context, null, com.android.internal.R.attr.actionButtonStyle); - mHomeLayout.setClickable(true); - mHomeLayout.setFocusable(true); - mHomeLayout.setOnClickListener(mHomeClickListener); mHomeLayout.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.MATCH_PARENT)); @@ -207,18 +202,18 @@ public class ActionBarView extends ViewGroup { a.recycle(); - if (mLogo != null || mIcon != null || mTitle != null) { - mLogoNavItem = new ActionMenuItem(context, 0, android.R.id.home, 0, 0, mTitle); - mHomeClickListener = new OnClickListener() { - public void onClick(View v) { - Context context = getContext(); - if (context instanceof Activity) { - Activity activity = (Activity) context; - activity.onOptionsItemSelected(mLogoNavItem); - } - } - }; - } + mLogoNavItem = new ActionMenuItem(context, 0, android.R.id.home, 0, 0, mTitle); + mHomeLayout.setOnClickListener(new OnClickListener() { + public void onClick(View v) { + Context context = getContext(); + if (context instanceof Activity) { + Activity activity = (Activity) context; + activity.onOptionsItemSelected(mLogoNavItem); + } + } + }); + mHomeLayout.setClickable(true); + mHomeLayout.setFocusable(true); } @Override |
