You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
pyricau edited this page Jan 14, 2012
·
4 revisions
Since AndroidAnnotations 1.0
onBackPressed()
Since Android 2.0, activities can implement onBackPressed() to modify the default behavior when the user presses the back key.
There was an article on the Android blog that showed how to reproduce this for pre 2.0 Android versions.
We automatically support that since AndroidAnnotations 2.1 (with issue 46): if an @EActivity annotated class has an onBackPressed() method, the generated class adds the needed code for support on pre 2.0 Android versions.
For instance:
@EActivitypublicclassMyActivityextendsActivity {
publicvoidonBackPressed() {
// Do something
}
}