Code example for ActionBarActivity

Methods: getIntent, getSupportActionBar, getSupportFragmentManager

0
	public void onServiceConnected(ComponentName name, IBinder b) {
		ServerConnectionService.ServiceBinder binder = (ServiceBinder) b;
		 
		service = binder.getService();
		 
		ServerConnection connection = service.getConnections().get( getIntent().getLongExtra(EXTRA_CONN_ID, -1) );
		 
		getSupportActionBar().setTitle( connection.getSettingsItem().getDisplayName() );
		getSupportActionBar().setSubtitle( connection.getSettingsItem().getDisplayAddress() );
		 
		if(getSupportFragmentManager().findFragmentById(android.R.id.content) == null) {
			//No fragment is currently shown 
			ServerWindowTilesFragment f =
					ServerWindowTilesFragment.createInstance( 
							getIntent().getLongExtra(EXTRA_CONN_ID, -1)
					); 
			 
			getSupportFragmentManager().beginTransaction() 
					.add(android.R.id.content, f)
					.commit(); 
		} 
	}