Its been a few years since I've done any Java Dev and I new to andriod also.
I've been going through some of the examples on this site and I'm having problems getting some of them to compile. This is particularly relating to overriding base functions.
for example (From the Toggle Button example)
Using java Syntax Highlighting
- public class ToggleButton extends Button {
- .............
- .............
- .............
- /** Return an array of resource IDs of
- * the Drawable states representing the
- * current state of the view. */
- @Override
- public int[] OnCreateDrawableState() {
- int[] states;
- if (this.isChecked()) {
- // Checked
- states = Button.PRESSED_STATE_SET;
- } else {
- // Unchecked
- if (super.hasFocus()) {
- /* Unchecked && Focus
- * System highlights the Button */
- states = super.OnCreateDrawableState();
- } else {
- // Unchecked && noFocus
- states = Button.LAST_STATE_SET;
- }
- }
- return states;
- }
- }
Parsed in 0.033 seconds, using GeSHi 1.0.8.4
Both the definition and call to OnCreateDrawableState generate the following errors
The method OnCreateDrawableState() is undefined for the type Button
The method OnCreateDrawableState() of type FocusButton must override a superclass method
I have the same issue when trying to compile the IconTextMenu example by sommeralex
Using java Syntax Highlighting
- public class IconTextMenuView extends LinearLayout implements
- android.view.View.OnClickListener {
- ...........
- ...........
- ...........
- @Override
- boolean onMotionEvent(MotionEvent event) {
- performClick();
- return super.onMotionEvent(event);
- }
- }
Parsed in 0.030 seconds, using GeSHi 1.0.8.4
Here the OnMotion override fails with
The method onMotionEvent(MotionEvent) is undefined for the type LinearLayout
The method onMotionEvent(MotionEvent) of type IconTextMenuView must override a superclass method
Perhaps I'm missing something obvious or maybe the implementation of the base classes has changed since these tutorials where created Im not sure. I'd be grateful if anyone could point me in the right direction.


