bindService是否还会调用onCreate方法?

时间:2019-07-02 04:22:48

标签: java android service bindservice

是否可以在不调用startService的情况下调用bindService?如果是这样,它还会在我的Service中调用我的onCreate方法吗?

  public static void bindMusicService(Context c){
        /*mediaPlayerServiceIntent binds our connection to the MediaPlayerService. */
        mediaPlayerServiceIntent = new Intent(c, MediaPlayerService.class);
        c.bindService(mediaPlayerServiceIntent, serviceConnection, Context.BIND_AUTO_CREATE);
        mServiceIsBound = true;
        Log.i("Main","Service is bound!");
    }

0 个答案:

没有答案