Receiver not registered exception error?

后端 未结 10 2250
醉酒成梦
醉酒成梦 2020-11-28 05:41

In my developer console people keep reporting an error that I cannot reproduce on any phone I have. One person left a message saying he gets it when they try to open the set

10条回答
  •  难免孤独
    2020-11-28 06:14

    For anybody who will come upon this problem and they tried all that was suggested and nothing still works, this is how I sorted my problem, instead of doing LocalBroadcastManager.getInstance(this).registerReceiver(...) I first created a local variable of type LocalBroadcastManager,

    private LocalBroadcastManager lbman;
    

    And used this variable to carry out the registering and unregistering on the broadcastreceiver, that is

    lbman.registerReceiver(bReceiver);
    

    and

    lbman.unregisterReceiver(bReceiver);
    

提交回复
热议问题