只有一个BroadcastReceiver允许接收Android应用内计费的计费广播吗?

| 我已经使Google的示例应用程序内计费应用程序(地牢)运行良好。但是,我正在尝试为我正在编写的应用程序注册另一个收款人,但我无法这样做。似乎只有在AndroidManifest.xml中声明的第一个接收方才是接收广播的接收方,但是在第一个接收方之后的任何接收方都不会接收广播。在运行时,我已经通过使用isOrderedBroadcast()确认广播不是有序广播,所以这好像不是我在某处中止广播(只能中止有序广播)。任何帮助,将不胜感激。     
已邀请:
也许第一个接收者必须先注销,然后第二个接收者才能完成其尝试做的事情。在您的活动中,重写onStop()方法,以便在活动关闭时取消注册广播接收器。这就是对我有用的东西。
// Import statements go here.

public class MyActivity extends AppCompatActivity implements IabBroadcastReceiver.IabBroadcastListener {

    // Other variables and methods go here.

    // Unregister the receiver when the activity closes.
    @Override
    protected void onStop()
    {
        try {
            unregisterReceiver(YOUR_BROADCAST_RECEIVER_VARIABLE_NAME_HERE);
        } catch (Exception ex) {
            // Uncomment the following for debugging.
            //ex.printStackTrace();
        }

        // Call the original onStop() method.
        super.onStop();
    }
}
    

要回复问题请先登录注册