title: MediaBrowserCompat.connect() never calls onConnected or any MediaBrowserCompat.ConnectionCallback method
body: <p>I am trying to connect my activity to a <code>MediaBrowserServiceCompat</code> service using <code>MediaBrowserCompat</code>.
  This is my activity:</p>
  
  <pre><code>@Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.bush_did_nine_eleven);
      Log.d("activity", " onCreate");
      mediaBrowser = new MediaBrowserCompat(this, new ComponentName(this, MusicServiceMediaBrowser.class), new MediaBrowserCompat.ConnectionCallback() {
                  @Override
                  public void onConnected() {
                      Log.d("activity", "onconnected");
                      super.onConnected();
                  }
  
                  @Override
                  public void onConnectionFailed() {
                      Log.d("activity", "onConnectionFailed");
                      super.onConnectionFailed();
                  }
  
                  @Override
                  public void onConnectionSuspended() {
                      Log.d("activity", "onConnectionSuspended");
                      super.onConnectionSuspended();
                  }
              }, null);
  
      mediaBrowser.connect();
      Log.d("activity", "mediaBrowser.connect() called");
  
  }
  
  @Override
  protected void onStart() {
      super.onStart();
      Log.d("activity", "onStart");
  }
  
  @Override
  protected void onStop() {
      super.onStop();
      Log.d("activity", "onStop");
      mediaBrowser.disconnect();
  }
  </code></pre>
  
  <p>you might expect one of the <code>ConnectionCallback</code> methods to be called, but this is what the logcat prints (including log called from the service):</p>
  
  <pre><code>09-08 19:28:25.126 13469-13469/le1.mytube D/activity:  onCreate
  09-08 19:28:25.135 13469-13469/le1.mytube D/activity: mediaBrowser.connect() called
  09-08 19:28:25.137 13469-13469/le1.mytube D/activity: onStart
  09-08 19:28:25.154 13469-13469/le1.mytube D/service: onCreate
  </code></pre>
  
  <p>it also crashes when in my service i call <code>setSessionToken(mediaSession.getSessionToken())</code>  with a <code>NullPointerException</code> :</p>
  
  <pre><code>09-08 19:34:04.817 19588-19588/le1.mytube E/AndroidRuntime: FATAL EXCEPTION: main
                                                              Process: le1.mytube, PID: 19588
                                                              Theme: themes:{}
                                                              java.lang.RuntimeException: Unable to create service le1.mytube.services.MusicServiceMediaBrowser: java.lang.NullPointerException: Attempt to invoke interface method 'void android.support.v4.media.MediaBrowserServiceCompat$MediaBrowserServiceImpl.setSessionToken(android.support.v4.media.session.MediaSessionCompat$Token)' on a null object reference
                                                                  at android.app.ActivityThread.handleCreateService(ActivityThread.java:2921)
                                                                  at android.app.ActivityThread.-wrap4(ActivityThread.java)
                                                                  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1446)
                                                                  at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                  at android.os.Looper.loop(Looper.java:148)
                                                                  at android.app.ActivityThread.main(ActivityThread.java:5461)
                                                                  at java.lang.reflect.Method.invoke(Native Method)
                                                                  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
                                                                  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
                                                               Caused by: java.lang.NullPointerException: Attempt to invoke interface method 'void android.support.v4.media.MediaBrowserServiceCompat$MediaBrowserServiceImpl.setSessionToken(android.support.v4.media.session.MediaSessionCompat$Token)' on a null object reference
                                                                  at android.support.v4.media.MediaBrowserServiceCompat.setSessionToken(MediaBrowserServiceCompat.java:999)
                                                                  at le1.mytube.services.MusicServiceMediaBrowser.onCreate(MusicServiceMediaBrowser.java:46)
                                                                  at android.app.ActivityThread.handleCreateService(ActivityThread.java:2911)
                                                                  at android.app.ActivityThread.-wrap4(ActivityThread.java) 
                                                                  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1446) 
                                                                  at android.os.Handler.dispatchMessage(Handler.java:102) 
                                                                  at android.os.Looper.loop(Looper.java:148) 
                                                                  at android.app.ActivityThread.main(ActivityThread.java:5461) 
                                                                  at java.lang.reflect.Method.invoke(Native Method) 
                                                                  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) 
                                                                  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) 
  </code></pre>
  
  <p>in my manifest i've add the necessary <code>&lt;action android:name="android.media.browse.MediaBrowserService"/&gt;</code> for the service if you are wondering.</p>
  
  <p>Am I doing something wrong or is it just a bug in appcompat(v7:25.3.1)?</p>