am 2f78d82a
: Merge "Don\'t show help menu when browser unavailable" into klp-dev
* commit '2f78d82ab3a2858b3265cf01099db455fb43f4b1': Don't show help menu when browser unavailable
This commit is contained in:
@@ -16,6 +16,7 @@
|
|||||||
|
|
||||||
package com.android.settings;
|
package com.android.settings;
|
||||||
|
|
||||||
|
import android.content.ComponentName;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.pm.PackageInfo;
|
import android.content.pm.PackageInfo;
|
||||||
@@ -95,9 +96,15 @@ public class HelpUtils {
|
|||||||
|
|
||||||
// Set the intent to the help menu item, show the help menu item in the overflow
|
// Set the intent to the help menu item, show the help menu item in the overflow
|
||||||
// menu, and make it visible.
|
// menu, and make it visible.
|
||||||
helpMenuItem.setIntent(intent);
|
ComponentName component = intent.resolveActivity(context.getPackageManager());
|
||||||
helpMenuItem.setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER);
|
if (component != null) {
|
||||||
helpMenuItem.setVisible(true);
|
helpMenuItem.setIntent(intent);
|
||||||
|
helpMenuItem.setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER);
|
||||||
|
helpMenuItem.setVisible(true);
|
||||||
|
} else {
|
||||||
|
helpMenuItem.setVisible(false);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// return that the help menu item is visible (i.e., true)
|
// return that the help menu item is visible (i.e., true)
|
||||||
return true;
|
return true;
|
||||||
|
Reference in New Issue
Block a user