I would like use my own extended ProgressBar class in Widget. I has created really simple MyProgressBar and if I place this into standart activity layout, it works. Of course I set also Style attribiute to "?android:attr/progressBarStyleHorizontal" in MyProgressBar property in designer.
But if I do same and place it to Widget layout, its visible good in layout designer in eclipse, however, widget does not work in traget. There is only "Problem loaing widget" message showed instead of widget layout .... on target device....
Source code for MyProgressBar is here :
public class MyProgressBar extends ProgressBar {
public MyProgressBar(Context context) {
super(context);
}
public MyProgressBar(Context context, AttributeSet attrs) {
super(context, attrs);
}
public MyProgressBar(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
}
@Override
protected synchronized void onDraw(Canvas canvas) {
// First draw the regular progress bar, then custom draw our text
super.onDraw(canvas);
}
}