summaryrefslogtreecommitdiffstats
path: root/core/java/android/app/Activity.java
diff options
context:
space:
mode:
authorAdam Powell <adamp@android.com>2013-01-03 17:37:49 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2013-01-03 17:37:49 -0800
commitb7de79d02743cc3b5372be27be818d3227a34e2b (patch)
treeb3b162d6efb8ab2d7b83783989384261fefc0d95 /core/java/android/app/Activity.java
parent28a7a05952b7c338f2c1746cb20a17e28358bffc (diff)
parent41bb82becea5dd1f995dbca5bf5a719f559102de (diff)
downloadframeworks_base-b7de79d02743cc3b5372be27be818d3227a34e2b.zip
frameworks_base-b7de79d02743cc3b5372be27be818d3227a34e2b.tar.gz
frameworks_base-b7de79d02743cc3b5372be27be818d3227a34e2b.tar.bz2
am 41bb82be: Merge "Fix NullpointException problem in onMenuItemSelected"
* commit '41bb82becea5dd1f995dbca5bf5a719f559102de': Fix NullpointException problem in onMenuItemSelected
Diffstat (limited to 'core/java/android/app/Activity.java')
-rw-r--r--core/java/android/app/Activity.java10
1 files changed, 8 insertions, 2 deletions
diff --git a/core/java/android/app/Activity.java b/core/java/android/app/Activity.java
index cbeffc1..3bdadc3 100644
--- a/core/java/android/app/Activity.java
+++ b/core/java/android/app/Activity.java
@@ -2539,12 +2539,16 @@ public class Activity extends ContextThemeWrapper
* Activity don't need to deal with feature codes.
*/
public boolean onMenuItemSelected(int featureId, MenuItem item) {
+ CharSequence titleCondensed = item.getTitleCondensed();
+
switch (featureId) {
case Window.FEATURE_OPTIONS_PANEL:
// Put event logging here so it gets called even if subclass
// doesn't call through to superclass's implmeentation of each
// of these methods below
- EventLog.writeEvent(50000, 0, item.getTitleCondensed().toString());
+ if(titleCondensed != null) {
+ EventLog.writeEvent(50000, 0, titleCondensed.toString());
+ }
if (onOptionsItemSelected(item)) {
return true;
}
@@ -2562,7 +2566,9 @@ public class Activity extends ContextThemeWrapper
return false;
case Window.FEATURE_CONTEXT_MENU:
- EventLog.writeEvent(50000, 1, item.getTitleCondensed().toString());
+ if(titleCondensed != null) {
+ EventLog.writeEvent(50000, 1, titleCondensed.toString());
+ }
if (onContextItemSelected(item)) {
return true;
}