hi,
i am trying to create my own custom view class. i want to know how to
add widgets such as
Buttons, TextView and ImageView to this custom view. i am hoping that
this view can somehow
use a layout xml file (programmatically styling it may be too hard).
Of course the main
activity's layout xml file will include the custom view:
<com.lam.customview.CustomDisplayView
android:id="@+id/custom_display_view1"
android:layout_width="fill_parent"
android:layout_height="fill_parent" />
i tried to do this:
public CustomDisplayView(Context context, AttributeSet attrs) {
super(context, attrs);
try
{
SurfaceHolder holder = getHolder();
holder.addCallback(this);
View.inflate(context, R.layout.custom_display_view, null);
...
but i keep getting exceptions such as Error inflating class
java.language.reflect.Contructor.
my layout xml file just has a TextView and an ImageView, the content
of which will change
based on certain conditions.
can someone help me? 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