public static void bind ( final Context context , final ServiceConnection connection ) { Intent serviceIntent = new Intent ( context , GoroService . class ) ; if ( context . startService ( serviceIntent ) == null ) { throw new GoroException ( "Service " + GoroService . class + " does not seem to be included to your manifest file" ) ; } boolean bound = context . bindService ( serviceIntent , connection , 0 ) ; if ( ! bound ) { throw new GoroException ( "Cannot bind to GoroService though this component seems to " + "be registered in the app manifest" ) ; } }
Bind to Goro service . This method will start the service and then bind to it .