Just try expanding the view and doing some special work, but Eclipse will complain when I try to override the setFrame method. The statement that there is no method to override in the parent class:
The setFrame (int, int, int, int, int) method of type Test must override or implement the supertype method
Here is the signature of the method from the source SDK for Android.
protected boolean setFrame(int left, int top, int right, int bottom)
As you can see, this is not a private or batch level, or even specified as final ... just protected. This should mean that I can completely override it in a subclass. Right? Below is the minimum size of what I'm trying to do in Eclipse. This might just be an Eclipse bug, but I'm not too familiar with Ant to check this out.
Edit: For those who answer that setFrame is not defined in the View class, I can assure you. How else do you think I have a method signature? It is even called during layout (). Or am I seriously just crazy?
git HEAD: View.java
Cupcake (1.5r4): View.java
You can even see that the method is overridden in ImageView and TextView ... so I am seriously confused about why I cannot override it directly from the view directly ...
public class Test extends View { public Test(Context context) { super(context); } public Test(Context context, AttributeSet attrs) { super(context, attrs); } public Test(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } @Override protected boolean setFrame(int left, int top, int right, int bottom) { return super.setFrame(left, top, right, bottom); } }