title: Android mapbox: How to unregister IntentReceiver?
body: <pre><code>mapView = (MapView) findViewById(R.id.mapview);
      mapView.onCreate(savedInstanceState);
  
      mapView.getMapAsync(new OnMapReadyCallback() {
          @Override
          public void onMapReady(MapboxMap mapboxMap) {
              my_function();
          }
      });
  </code></pre>
  
  <p>in my_function() i use this subscriber:</p>
  
  <pre><code>GetDataSubscription = model.getData()
              .subscribeOn(Schedulers.io())
              .observeOn(AndroidSchedulers.mainThread())
              .subscribe();
  </code></pre>
  
  <p>when Subscription starts i have this errors:</p>
  
  <blockquote>
    <p>java.lang.IllegalStateException: Fatal Exception thrown on Scheduler.Worker thread.
                                                                                            at rx.internal.schedulers.ScheduledAction.run(ScheduledAction.java:62)
                                                                                            at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:422)
                                                                                            at java.util.concurrent.FutureTask.run(FutureTask.java:237)
                                                                                            at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:152)
                                                                                            at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:265)
                                                                                            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
                                                                                            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
                                                                                            at java.lang.Thread.run(Thread.java:841)
                                                                                         Caused by: java.lang.NoClassDefFoundError: okhttp3.internal.Platform
                                                                                            at okhttp3.logging.HttpLoggingInterceptor$Logger$1.log(HttpLoggingInterceptor.java:112)
                                                                                            at okhttp3.logging.HttpLoggingInterceptor.intercept(HttpLoggingInterceptor.java:160)
                                                                                            at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
                                                                                            at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
                                                                                            at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:170)
                                                                                            at okhttp3.RealCall.execute(RealCall.java:60)
                                                                                            at retrofit2.OkHttpCall.execute(OkHttpCall.java:174)
                                                                                            at retrofit2.adapter.rxjava.RxJavaCallAdapterFactory$RequestArbiter.request(RxJavaCallAdapterFactory.java:171)
                                                                                            at rx.internal.operators.OperatorSubscribeOn$1$1$1.request(OperatorSubscribeOn.java:80)
                                                                                            at rx.Subscriber.setProducer(Subscriber.java:211)
                                                                                            at rx.internal.operators.OperatorSubscribeOn$1$1.setProducer(OperatorSubscribeOn.java:76)
                                                                                            at rx.Subscriber.setProducer(Subscriber.java:205)
                                                                                            at retrofit2.adapter.rxjava.RxJavaCallAdapterFactory$CallOnSubscribe.call(RxJavaCallAdapterFactory.java:152)
                                                                                            at retrofit2.adapter.rxjava.RxJavaCallAdapterFactory$CallOnSubscribe.call(RxJavaCallAdapterFactory.java:138)
                                                                                            at rx.Observable$2.call(Observable.java:233)
                                                                                            at rx.Observable$2.call(Observable.java:225)
                                                                                            at rx.Observable.unsafeSubscribe(Observable.java:8741)
                                                                                            at rx.internal.operators.OperatorSubscribeOn$1.call(OperatorSubscribeOn.java:94)
                                                                                            at rx.internal.schedulers.ScheduledAction.run(ScheduledAction.java:55)
                                                                                            at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:422) 
                                                                                            at java.util.concurrent.FutureTask.run(FutureTask.java:237) 
                                                                                            at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:152) 
                                                                                            at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:265) 
                                                                                            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112) 
                                                                                            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) 
                                                                                            at java.lang.Thread.run(Thread.java:841) </p>
  </blockquote>
  
  <p>and</p>
  
  <blockquote>
    <p>MainActivity has leaked IntentReceiver com.mapbox.mapboxsdk.net.ConnectivityReceiver@9d069e70 that was originally registered here. Are you missing a call to unregisterReceiver()?
                                                                                        android.app.IntentReceiverLeaked: Activity .MainActivity has leaked IntentReceiver com.mapbox.mapboxsdk.net.ConnectivityReceiver@9d069e70 that was originally registered here. Are you missing a call to unregisterReceiver()?
                                                                                            at android.app.LoadedApk$ReceiverDispatcher.(LoadedApk.java:805)
                                                                                            at android.app.LoadedApk.getReceiverDispatcher(LoadedApk.java:606)
                                                                                            at android.app.ContextImpl.registerReceiverInternal(ContextImpl.java:1430)
                                                                                            at android.app.ContextImpl.registerReceiver(ContextImpl.java:1410)
                                                                                            at android.app.ContextImpl.registerReceiver(ContextImpl.java:1404)
                                                                                            at android.content.ContextWrapper.registerReceiver(ContextWrapper.java:467)
                                                                                            at com.mapbox.mapboxsdk.net.ConnectivityReceiver.instance(ConnectivityReceiver.java:35)
                                                                                            at com.mapbox.mapboxsdk.MapboxAccountManager.start(MapboxAccountManager.java:53)
                                                                                            at info.masterskaya.om.rxjavanetexample.MainActivity.onCreate(MainActivity.java:39)
                                                                                            at android.app.Activity.performCreate(Activity.java:5231)
                                                                                            at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
                                                                                            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2159)
                                                                                            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
                                                                                            at android.app.ActivityThread.access$800(ActivityThread.java:135)
                                                                                            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
                                                                                            at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                                            at android.os.Looper.loop(Looper.java:136)
                                                                                            at android.app.ActivityThread.main(ActivityThread.java:5017)
                                                                                            at java.lang.reflect.Method.invokeNative(Native Method)
                                                                                            at java.lang.reflect.Method.invoke(Method.java:515)
                                                                                            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
                                                                                            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
                                                                                            at dalvik.system.NativeStart.main(Native Method)</p>
  </blockquote>