super.onCreate(savedInstanceState);
ScrollView scrollView = new ScrollView(this);
GridLayout container = new GridLayout(this);
scrollView.addView(container);
container.setColumnCount(5);
container.setBackgroundColor(0xFF888888);
DecimalFormat df = new DecimalFormat("#.##");
long time = android.os.SystemClock.elapsedRealtimeNanos();
for (int i = 0; i < icon.length; i++) {
Button button = new Button(this);
button.setWidth(200);
button.setBackgroundResource(icon[i]);
container.addView(button);
}
setContentView(scrollView);
time = android.os.SystemClock.elapsedRealtimeNanos()-time;
TextView t = new TextView(this);
t.setText("avgS=" + df.format(time / (icon.length * 1000000.)) + " ms");
container.addView(t);