Skip to content
This repository has been archived by the owner on Dec 29, 2019. It is now read-only.

IllegalArgumentException: Receiver not registered #16

Open
JIO6CTEPok opened this issue Aug 24, 2016 · 0 comments
Open

IllegalArgumentException: Receiver not registered #16

JIO6CTEPok opened this issue Aug 24, 2016 · 0 comments

Comments

@JIO6CTEPok
Copy link

i getting exception after clicked "Stop Discovery" button (you example).

ACRA: com.lo6ctep.wifiscaner fatal error : Receiver not registered: com.peak.salut.SalutBroadcastReceiver@41d0aab0
java.lang.IllegalArgumentException: Receiver not registered: com.peak.salut.SalutBroadcastReceiver@41d0aab0
at android.app.LoadedApk.forgetReceiverDispatcher(LoadedApk.java:667)
at android.app.ContextImpl.unregisterReceiver(ContextImpl.java:1549)
at android.content.ContextWrapper.unregisterReceiver(ContextWrapper.java:489)
at com.peak.salut.Salut.stopServiceDiscovery(Salut.java:832)
at com.lo6ctep.wifiscaner.MainActivity.discoverServices(MainActivity.java:111)

111 line:

  private void discoverServices() {
        Log.d(TAG, "current runningAsHost=" + network.isRunningAsHost);
        Log.d(TAG, "current isDiscovering=" + network.isDiscovering);
        if (!network.isRunningAsHost && !network.isDiscovering) {
            listView.setAdapter(new DevicesAdapter(MainActivity.this, network.foundDevices));
            network.discoverNetworkServices(new SalutDeviceCallback() {
                @Override
                public void call(SalutDevice salutDevice) {
                    listView.setAdapter(new DevicesAdapter(MainActivity.this, network.foundDevices));
                    Toast.makeText(getApplicationContext(), "Device: " + network.foundDevices.get(0).instanceName + " found.", Toast.LENGTH_SHORT).show();
                }
            }, true);
            scanButton.setText("Stop Discovery");
            serverButton.setAlpha(0.5f);
            serverButton.setClickable(false);
        } else {
            network.stopServiceDiscovery(true); //line 111
            scanButton.setText("Discover Services");
            serverButton.setAlpha(1f);
            serverButton.setClickable(true);
        }
    }

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant