Skip to content

BroadcastReceiver.onReceive always run in the UI thread #75

Open
@wangsuicheng

Description

@wangsuicheng
return new BroadcastReceiver() {
      @Override public void onReceive(Context context, Intent intent) {
        wifiManager.startScan();
        emitter.onNext(wifiManager.getScanResults());
      }
    };

BroadcastReceiver.onReceive always run in the UI thread, so
getScanResults() and startScan still block ui thread

https://stackoverflow.com/questions/5674518/does-broadcastreceiver-onreceive-always-run-in-the-ui-thread

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions