super.onCreate(savedInstanceState);
final LinearLayout layout = new LinearLayout(this);
layout.setOrientation(LinearLayout.VERTICAL);
final GammaTextView gamma = new GammaTextView(this);
layout.addView(gamma, new LinearLayout.LayoutParams(
LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT
));
setContentView(layout);
layout.post(new Runnable() {
public void run() {
Bitmap b = Bitmap.createBitmap(gamma.getWidth(), gamma.getHeight(),
Bitmap.Config.ARGB_8888);
Canvas c = new Canvas(b);
c.drawColor(0, PorterDuff.Mode.CLEAR);
gamma.draw(c);
ImageView image = new ImageView(TextGammaActivity.this);
image.setImageBitmap(b);
layout.addView(image, new LinearLayout.LayoutParams(
LinearLayout.LayoutParams.WRAP_CONTENT,
LinearLayout.LayoutParams.WRAP_CONTENT
));
startActivity(new Intent(TextGammaActivity.this, SubGammaActivity.class));
}
});
getWindow().setBackgroundDrawable(new ColorDrawable(0xffffffff));