[Android] Reshow game menu after leaving settings

This commit is contained in:
zilmar 2016-10-02 07:45:49 +11:00
parent df4ecbfee1
commit 628a0d769d
2 changed files with 129 additions and 120 deletions

View File

@ -99,6 +99,7 @@ public class GalleryActivity extends AppCompatActivity implements IabBroadcastLi
// (arbitrary) request code for the purchase flow
static final int RC_REQUEST = 10001;
static final int RC_SETTINGS = 10002;
@Override
protected void onNewIntent( Intent intent )
@ -570,7 +571,7 @@ public class GalleryActivity extends AppCompatActivity implements IabBroadcastLi
else if (item == 3)
{
Intent SettingsIntent = new Intent(finalContext, GameSettingsActivity.class);
startActivity( SettingsIntent );
startActivityForResult( SettingsIntent, RC_SETTINGS );
}
}
});
@ -612,6 +613,14 @@ public class GalleryActivity extends AppCompatActivity implements IabBroadcastLi
{
Log.d("GalleryActivity", "onActivityResult(" + requestCode + "," + resultCode + "," + data);
if (requestCode == RC_SETTINGS)
{
File InstantSaveDir = new File(NativeExports.SettingsLoadString(SettingsID.Directory_InstantSave.getValue()));
final File GameSaveDir = new File(InstantSaveDir,NativeExports.SettingsLoadString(SettingsID.Game_UniqueSaveDir.getValue()));
StartGameMenu(GameSaveDir, true);
return;
}
// Check which request we're responding to
if (requestCode == GAME_DIR_REQUEST_CODE)
{