Code example for FragmentActivity

Methods: onBackPressed

0
	} 
	 
	@Override 
	public void onBackPressed() { 
		prepareSuccessfulResult(); 
		super.onBackPressed(); 
	} 
 
	@Override 
	public void closeDetailView(final boolean error) {
		if (!error) {
			prepareSuccessfulResult(); 
		} else { 
			setResult(RESULT_CANCELED); 
		} 
		finish(); 
	} 
	 
	private void prepareSuccessfulResult() { 
		Fragment frag = getSupportFragmentManager().findFragmentById(R.id.game_detail_frame);
		if (frag != null && frag instanceof TichuGameDetailFragment) {