Code example for FragmentActivity

Methods: getSupportFragmentManager

0
	 
	@Override 
	public boolean onKeyDown(int keyCode, KeyEvent event){
		if(keyCode == KeyEvent.KEYCODE_MENU){
			 
			 FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
	         //ft.setCustomAnimations(android.R.anim.slide_in_left, android.R.anim.slide_out_right); 
	        // ft.add(R.id.settingsFragment, settingsFragment); 
	         settingsDialogFragment.show(ft, "settings");
	         return true; 
		} 
		 
		if(keyCode == KeyEvent.KEYCODE_BACK){
			//exit dialog 
			FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
			pausedDialogFragment.show(ft, "paused");
			return true; 
		} 
		 
		return super.onKeyDown(keyCode, event);