Problem relied with BroadcastReceiver
as it is done asynchronously, somehow putting it a separate Thread than MainThread
looks for the class in a wrong place.
What I ended up doing was initialising variable responsible for BroadcastReceiver
in the class constructor as class variable then .start()
when you press button Start and .stop()
when you Stop the device scan. Then, as a precaution I defined the BroadcastReceiver
variable to None and redefined it same way as in the constructor but in the function responsible for stopping the scan.