订阅取消的广播接收器

时间:2017-01-03 14:03:56

标签: android in-app-billing

如果用户取消订阅,有没有办法接收接收器?

也许类似于IabBroadcastReceiver?

public class IabBroadcastReceiver extends BroadcastReceiver {
/**
 * Listener interface for received broadcast messages.
 */
public interface IabBroadcastListener {
    void receivedBroadcast();
}

/**
 * The Intent action that this Receiver should filter for.
 */
public static final String ACTION = "com.android.vending.billing.PURCHASES_UPDATED";

private final IabBroadcastListener mListener;

public IabBroadcastReceiver(IabBroadcastListener listener) {
    mListener = listener;
}

@Override
public void onReceive(Context context, Intent intent) {
    if (mListener != null) {
        mListener.receivedBroadcast();
    }
}
}

任何其他解决方案都很有用

0 个答案:

没有答案