mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-15 02:08:00 +00:00
Refactor restart code so app can support restarting
Add Landscape Mode setting to app
This commit is contained in:
@@ -91,7 +91,7 @@ public class Main extends AndroidApplication {
|
||||
private AndroidAdapter(Context context) {
|
||||
isTablet = (context.getResources().getConfiguration().screenLayout
|
||||
& Configuration.SCREENLAYOUT_SIZE_MASK)
|
||||
>= Configuration.SCREENLAYOUT_SIZE_XLARGE;
|
||||
>= Configuration.SCREENLAYOUT_SIZE_LARGE;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -139,6 +139,15 @@ public class Main extends AndroidApplication {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void restart() {
|
||||
// Replace the current task with a new one for this
|
||||
final Intent restart = new Intent(Main.this, Main.class)
|
||||
.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK // CLEAR_TASK requires this
|
||||
| Intent.FLAG_ACTIVITY_CLEAR_TASK); // finish everything else in the task
|
||||
startActivity(restart);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void exit() {
|
||||
// Replace the current task with one that is excluded from the recent
|
||||
|
||||
Reference in New Issue
Block a user