public static boolean reserveOverflow(Context context) {
   if (Build.VERSION.SDK_INT < Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
     return (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB);
   } else {
     return !HasPermanentMenuKey.get(context);
   }
 }
Exemplo n.º 2
0
  public static boolean reserveOverflow(Context context) {
    // Check for theme-forced overflow action item
    TypedArray a = context.getTheme().obtainStyledAttributes(R.styleable.SherlockTheme);
    boolean result = a.getBoolean(R.styleable.SherlockTheme_absForceOverflow, false);
    a.recycle();
    if (result) {
      return true;
    }

    if (Build.VERSION.SDK_INT < Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
      return (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB);
    } else {
      return !HasPermanentMenuKey.get(context);
    }
  }