Hi,
What is the effect of calling setContentView() in an activity twice?
My situation:
class A extends Activity {
protected TextView mLabel;
public void onCreate() {
super.onCreate();
setContentView(R.layout.a);
mLabel = (TextView)findViewById(R.id.label);
}
}
class B extends A {
protected ImageView mImageView;
public void onCreate() {
super.onCreate();
setContentView(R.layout.b);
mImageView = (ImageView)findViewById(R.id.photo);
mLabel.setText("hello");
}
}
this works, but not sure if it's ok to do this. Basically the parent
activity initializes a bunch of stuff that B will use too, B just
wants to add an additional ImageView for itself. So layout.a and
layout.b are the same, they're a copy-paste of one another. B just has
an extra ImageView appended.
Thanks
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
To unsubscribe, reply using "remove me" as the subject.