Code example for TableLayout

Methods: removeAllViewsrequestLayout

0
  } 
 
  @Override 
  public final void onAttachedToWindow() { 
    withView(ALPHA);
    grid.requestLayout();
  } 
 
  private JumpDialog flip(boolean fromAlpha) {
    return withView(fromAlpha ? NUMER : ALPHA);
  } 
 
  private JumpDialog withView(String[] opts) {
	grid.removeAllViews(); 
    TableRow row = new TableRow(getContext()); 
    Display display = getWindow().getWindowManager().getDefaultDisplay(); 
    cols = Math.min(display.getHeight(), display.getWidth()) / 80; 
    for (int i = 0; i < opts.length; i++) { 
 
      if (i % cols == 0 || i == opts.length - 1) { 
        grid.addView(row);