예제 #1
0
  /**
   * 新版flyme下已失效
   *
   * @param activity
   */
  @Deprecated
  public static final void hide(Activity activity) {
    if (!isMX2()) return;

    ActionBar actionBar = activity.getActionBar();
    if (actionBar == null) {
      return;
    }
    Class<? extends ActionBar> ActionBarClass = actionBar.getClass();
    Method setTabsShowAtBottom;
    try {
      setTabsShowAtBottom = ActionBarClass.getMethod("setTabsShowAtBottom", Boolean.TYPE);
      setTabsShowAtBottom.invoke(activity.getActionBar(), true);
    } catch (NoSuchMethodException e) {
      e.printStackTrace();
    } catch (IllegalArgumentException e) {
      e.printStackTrace();
    } catch (IllegalAccessException e) {
      e.printStackTrace();
    } catch (InvocationTargetException e) {
      e.printStackTrace();
    }
  }