I’m trying to override the onBackPressed() method of the ActivityGroup class:
public class MyClass extends ActivityGroup {
@Override
public void onBackPressed() {
// do something
return;
}
but I’m getting the error The method onBackPressed() of type MyClass must override a superclass method.
I’m relatively new to Java, I’ve seen here that people do it and it works for them
Why I’m getting this error?
I’m writing an app for android 1.5, could the problem be here?
Edit
You need to override the back button like this
Yes u r correct
onBackPressed()method has been introduced only in API Level 5 which means you can use it only from 2.0 SDK