FileDocCategorySizeDatePackage
BitmapDrawableDupe.javaAPI DocAndroid 5.1 API2985Thu Mar 12 22:22:44 GMT 2015com.android.test.dynamic

BitmapDrawableDupe

public class BitmapDrawableDupe extends android.app.Activity

Fields Summary
private static final String
LOGCAT
protected int[]
icon
Constructors Summary
Methods Summary
protected voidonCreate(android.os.Bundle savedInstanceState)


    
        
        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);