Add extension.onBackPressed (for Android)
This commit is contained in:
@@ -33,6 +33,13 @@ public class Extension {
|
||||
}
|
||||
|
||||
|
||||
public boolean onBackPressed () {
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Called when the activity is starting.
|
||||
*/
|
||||
|
||||
@@ -33,6 +33,13 @@ public class Extension {
|
||||
}
|
||||
|
||||
|
||||
public boolean onBackPressed () {
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Called when the activity is starting.
|
||||
*/
|
||||
|
||||
@@ -453,6 +453,23 @@ public class GameActivity extends Activity implements SensorEventListener {
|
||||
}
|
||||
|
||||
|
||||
@Override public void onBackPressed () {
|
||||
|
||||
for (Extension extension : extensions) {
|
||||
|
||||
if (!extension.onBackPressed ()) {
|
||||
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
super.onBackPressed ();
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override protected void onDestroy () {
|
||||
|
||||
for (Extension extension : extensions) {
|
||||
|
||||
@@ -56,6 +56,23 @@ public class GameActivity extends SDLActivity {
|
||||
}
|
||||
|
||||
|
||||
@Override public void onBackPressed () {
|
||||
|
||||
for (Extension extension : extensions) {
|
||||
|
||||
if (!extension.onBackPressed ()) {
|
||||
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
super.onBackPressed ();
|
||||
|
||||
}
|
||||
|
||||
|
||||
protected void onCreate (Bundle state) {
|
||||
|
||||
super.onCreate (state);
|
||||
|
||||
Reference in New Issue
Block a user