+ // bind to Operations Service\r
+ mOperationsConnection = new ServiceConnection() {\r
+\r
+ @Override\r
+ public void onServiceConnected(ComponentName name, IBinder service) {\r
+ Log_OC.d(TAG, "Operations service connected");\r
+ mOperationsBinder = (OperationsServiceBinder) service;\r
+ }\r
+\r
+ @Override\r
+ public void onServiceDisconnected(ComponentName name) {\r
+ Log_OC.d(TAG, "Operations service crashed");\r
+ mOperationsBinder = null;\r
+ }\r
+ \r
+ };\r
+ if (!bindService(new Intent(this, OperationsService.class), \r
+ mOperationsConnection, \r
+ Context.BIND_AUTO_CREATE)) {\r
+ Toast.makeText(this, \r
+ R.string.error_cant_bind_to_operations_service, \r
+ Toast.LENGTH_LONG)\r
+ .show();\r
+ finish();\r
+ }\r
+\r