Code example for FragmentActivity

Methods: finish, getApplicationContext, setIntent, startActivity

0
						getFragment()).commit(); 
	} 
 
	@Override 
	protected void onNewIntent(Intent intent) {
		setIntent(intent);
		handleIntent(intent);
	} 
 
	void handleIntent(Intent intent) {
		if (intent == null) return;
 
		if (Intent.ACTION_SEARCH.equals(intent.getAction())) {
			mQuery = intent.getStringExtra(SearchManager.QUERY);
		} 
		else if (Intent.ACTION_VIEW.equals(intent.getAction())) {
			intent.setClass(getApplicationContext(), ActivityMain_.class);
			startActivity(intent);
			finish(); 
		} 
	} 
 
	@Override 
	public boolean onOptionsItemSelected(MenuItem item) {