views:

334

answers:

1

How can you dynamically create a CheckedTextView in android [without creating a new implementation]?

It seems CheckedTextView is abstract ... (which does not make any sense at all) because I keep getting the compile time error: "Cannot instantiate the type CheckedTextView"

Using Android 1.5

+1  A: 

Looking at the docs, the class is not abstract and has constructors. Presumably, therefore, you can call:

new CheckedTextView(this);

where this is your Activity, and get a CheckedTextView.

Have you run into problems using this?

CommonsWare
You Cannot instantiate the type CheckedTextView
Tawani
android.widget.CheckedTextView tv=new android.widget.CheckedTextView(this); works just fine. I just compiled it and ran it and encountered no compiler or runtime errors. So, yes, you can instantiate CheckedTextView. This is on Android 2.0.1.
CommonsWare