Code example for ActionBarActivity

Methods: bindService, getApplicationContext, onStart

0
		dbHelper = new SettingsDatabaseHelper(this);
	} 
	 
	@Override 
	protected void onStart() { 
		super.onStart(); 
		 
		Intent serviceIntent = new Intent(getApplicationContext(), ServerConnectionService.class);
		bindService(serviceIntent, this, 0);
	} 
	 
	@Override 
	protected void onStop() { 
		if(service != null) unbindService(this);
		 
		dbHelper.close();
		 
		super.onStop(); 
	} 
 
Stop searching for code, let great code find you!  Add Codota to your java IDE