mirror of
				https://github.com/bspeice/itcs4180
				synced 2025-11-03 18:00:37 -05:00 
			
		
		
		
	Kill the application when the Exit button of the ResultActivity is
pressed.
This commit is contained in:
		@ -38,6 +38,10 @@ public class MainActivity extends Activity
 | 
			
		||||
		super.onCreate(savedInstanceState);
 | 
			
		||||
		setContentView(R.layout.activity_main);
 | 
			
		||||
		
 | 
			
		||||
		// If the result activity calls us with an EXIT in the extras, quit.
 | 
			
		||||
		if (getIntent().getBooleanExtra("EXIT", false))
 | 
			
		||||
			finish();
 | 
			
		||||
		
 | 
			
		||||
		newGame((View)findViewById(R.id.LinearLayout1));
 | 
			
		||||
		focusImages.get(focusIndex).show();
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
@ -55,8 +55,11 @@ public class ResultActivity extends Activity {
 | 
			
		||||
			intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
 | 
			
		||||
			startActivity(intent);
 | 
			
		||||
		}
 | 
			
		||||
		else if (v.getId() == R.id.btnExit)
 | 
			
		||||
			finish();
 | 
			
		||||
		else if (v.getId() == R.id.btnExit){
 | 
			
		||||
			intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
 | 
			
		||||
			intent.putExtra("EXIT", true);
 | 
			
		||||
			startActivity(intent);
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user