title: Android app is freezing when MQTT event occurred
body: <p>When the application is open and MQTT event-triggered then I am facing this error. I am tried to reopen the activity but the activity is not found and I not able to understand How the activity is lost and how to resolve this error.</p>
  <pre><code>Error receiving broadcast Intent { act=driver.RIDER_NEW_TRIP_REQUEST flg=0x10 (has extras) } in driver.base.home.presentation.HomeActivity$4@ecbe5e6 
   at android.app.LoadedApk$ReceiverDispatcher$Args.lambda$getRunnable$0$LoadedApk$ReceiverDispatcher$Args(LoadedApk.java:1656) 
   at android.app.-$$Lambda$LoadedApk$ReceiverDispatcher$Args$_BumDX2UKsnxLVrE6UJsJZkotuA.run(Unknown Source:2) at android.os.Handler.handleCallback(Handler.java:883) 
   at android.os.Handler.dispatchMessage(Handler.java:100) 
   at android.os.Looper.loop(Looper.java:237) 
   at android.app.ActivityThread.main(ActivityThread.java:7814) 
   at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) 
   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1068) 
  Caused by: java.lang.IllegalStateException: Fragment GiveRideFragment{77827c8} not attached to a context. 
   at androidx.fragment.app.Fragment.requireContext(Fragment.java:696) 
   at androidx.fragment.app.Fragment.getResources(Fragment.java:760) 
   at androidx.fragment.app.Fragment.getString(Fragment.java:782) 
   at driver.feature.giveRide.presentation.GiveRideFragment.display(GiveRideFragment.java:2763) 
   at driver.shared.datastore.DriverRequestQueue.poll(DriverRequestQueue.java:65) 
   at driver.feature.giveRide.presentation.GiveRideFragment.fetchCurrentTripData(GiveRideFragment.java:910) 
   at driver.feature.giveRide.presentation.GiveRideFragment.makeAPICalls(GiveRideFragment.java:833) 
   at driver.base.home.presentation.HomeActivity$4.onReceive(HomeActivity.java:625)
  
  
  
  if (intent != null) {
                      Log.e(&quot;MQTT received :&quot;, &quot;YES&quot;);
                      Log.e(&quot;MQTT received sound : &quot;, &quot;YES&quot;);
  
                      RiderNewTripRequest riderNewTripRequest = (RiderNewTripRequest) intent.
                              getSerializableExtra(Constants.IntentKey.RiderNewTripRequest);
  
                      Log.e(&quot;MQTT receivedrequest: &quot;, &quot;YES&quot;);
                      if (riderNewTripRequest != null) {
  
                          binding.navDrawer.itemNavGiveRide.setBackgroundColor(ContextCompat.getColor(
                                  HomeActivity.this, R.color.colorHighlight));
                          closeDrawers();
                          Fragment frg = null;
                          frg = getSupportFragmentManager().findFragmentById(R.id.container);
                          final FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
                          assert frg != null;
                          ft.detach(frg);
                          ft.attach(frg);
                          ft.commit();
                          if (currentFrag() instanceof GiveRideFragment) {
                              Log.e(&quot;MQTT requestttttt &quot;, &quot;YES&quot;);
                              giveRideFragment.makeAPICalls(riderNewTripRequest);
                          }
                      }
                  }
  </code></pre>