Java tutorial
//package com.java2s; //License from project: Apache License import android.app.ActionBar; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; public class Main { public static void setActionBarViewCollapsable(ActionBar actionbar, boolean collapsable) { try { Method method = Class.forName("android.app.ActionBar").getMethod("setActionBarViewCollapsable", new Class[] { boolean.class }); try { method.invoke(actionbar, collapsable); } catch (IllegalArgumentException e) { e.printStackTrace(); } catch (IllegalAccessException e) { e.printStackTrace(); } catch (InvocationTargetException e) { e.printStackTrace(); } } catch (SecurityException e) { e.printStackTrace(); } catch (NoSuchMethodException e) { e.printStackTrace(); } catch (ClassNotFoundException e) { e.printStackTrace(); } } }