am d135f74b
: am 151af19b
: Fix bug 2651076 - Catch/log ActivityNotFoundException in MenuItemImpl.invoke()
Merge commit 'd135f74b972b88de2ae8b11b3ada886d29c1e25d' into kraken * commit 'd135f74b972b88de2ae8b11b3ada886d29c1e25d': Fix bug 2651076 - Catch/log ActivityNotFoundException in MenuItemImpl.invoke()
This commit is contained in:
@ -16,10 +16,12 @@
|
|||||||
|
|
||||||
package com.android.internal.view.menu;
|
package com.android.internal.view.menu;
|
||||||
|
|
||||||
import com.android.internal.view.menu.MenuView.ItemView;
|
import java.lang.ref.WeakReference;
|
||||||
|
|
||||||
|
import android.content.ActivityNotFoundException;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.graphics.drawable.Drawable;
|
import android.graphics.drawable.Drawable;
|
||||||
|
import android.util.Log;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
import android.view.SubMenu;
|
import android.view.SubMenu;
|
||||||
@ -28,12 +30,14 @@ import android.view.ViewDebug;
|
|||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.view.ContextMenu.ContextMenuInfo;
|
import android.view.ContextMenu.ContextMenuInfo;
|
||||||
|
|
||||||
import java.lang.ref.WeakReference;
|
import com.android.internal.view.menu.MenuView.ItemView;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
public final class MenuItemImpl implements MenuItem {
|
public final class MenuItemImpl implements MenuItem {
|
||||||
|
private static final String TAG = "MenuItemImpl";
|
||||||
|
|
||||||
private final int mId;
|
private final int mId;
|
||||||
private final int mGroup;
|
private final int mGroup;
|
||||||
private final int mCategoryOrder;
|
private final int mCategoryOrder;
|
||||||
@ -147,8 +151,12 @@ public final class MenuItemImpl implements MenuItem {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (mIntent != null) {
|
if (mIntent != null) {
|
||||||
|
try {
|
||||||
mMenu.getContext().startActivity(mIntent);
|
mMenu.getContext().startActivity(mIntent);
|
||||||
return true;
|
return true;
|
||||||
|
} catch (ActivityNotFoundException e) {
|
||||||
|
Log.e(TAG, "Can't find activity to handle intent; ignoring", e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
Reference in New Issue
Block a user