79230688

Date: 2024-11-27 14:30:14
Score: 0.5
Natty:
Report link

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.

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: kannic