private static void bindService ( ) { synchronized ( Command . class ) { if ( ! IS_BIND ) { Context context = Cmd . getContext ( ) ; if ( context == null ) { throw new NullPointerException ( "Context not should null. Please call Cmd.init(Context)" ) ; } else { // Cmd service context . bindService ( new Intent ( context , CommandService . class ) , I_CONN , Context . BIND_AUTO_CREATE ) ; IS_BIND = true ; } } } }
Start bind Service