Tuesday, February 11, 2014

Android - How to force use of overflow menu on devices with menu button

http://stackoverflow.com/questions/9286822/how-to-force-use-of-overflow-menu-on-devices-with-menu-button

try {
        ViewConfiguration config = ViewConfiguration.get(this);
        Field menuKeyField = ViewConfiguration.class.getDeclaredField("sHasPermanentMenuKey");
        if(menuKeyField != null) {
            menuKeyField.setAccessible(true);
            menuKeyField.setBoolean(config, false);
        }
    } catch (Exception ex) {
        // Ignore
    }

Java primitives types size chart

Below in the chart the size (in bytes) of primitive type goes next to its name.

1  byte
2  short
4  int
8  long
8  double
4  float
2  char
1  boolean

The way to highlite grid's selected rows in GXT v2

public void colorLockedGridRows() {
Grid grid = gridView.getGrid();
ListStore<BeanModel> store = grid.getStore();

for (BeanModel model : store.getModels()) {
SecurityGroupVO bean = model.getBean();
if ( bean.isLocked() ) {
Element row = grid.getView().getRow(model);
row.addClassName("locked-row-background-color");
}
}
}