How to create in-app billing in application?
<p>I use example from Android developers, and have created code:</p>

<pre><code>package com.nda.quizapp;

import com.nda.dungeons.BillingService;
import com.nda.dungeons.Consts;
import com.nda.dungeons.ResponseHandler;
import com.nda.dungeons.Consts.PurchaseState;
import com.nda.dungeons.Consts.ResponseCode;
import com.nda.dungeons.PurchaseObserver;

import com.nda.dungeons.Consts.PurchaseState;
import com.nda.dungeons.Consts.ResponseCode;
import com.nda.dungeons.BillingService.RequestPurchase;
import com.nda.dungeons.BillingService.RestoreTransactions;

import android.app.Activity;
import android.os.Bundle;
import android.os.Handler;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.Toast;

public class QuizappUpgradeActivity extends Activity implements OnClickListener{

    private class QuestionsPurchaseObserver extends PurchaseObserver {

        public QuestionsPurchaseObserver(Handler handler) {
            super(QuizappUpgradeActivity.this, handler);
        }

        public QuestionsPurchaseObserver(Activity activity, Handler handler) {
            super(activity, handler);
            // TODO Auto-generated constructor stub
        }

        @Override
        public void onBillingSupported(boolean supported) {
            // TODO Auto-generated method stub
            Log.e("method", "onBillingSupported");
        }

        @Override
        public void onPurchaseStateChange(PurchaseState purchaseState,
                String itemId, int quantity, long purchaseTime,
                String developerPayload) {
            // TODO Auto-generated method stub
            Log.e("method", "onPurchaseStateChange");
        }

        @Override
        public void onRequestPurchaseResponse(RequestPurchase request,
                ResponseCode responseCode) {
            Log.e("method", "onRequestPurchaseResponse");
            // TODO Auto-generated method stub
            if (responseCode == ResponseCode.RESULT_OK) {
                Log.e("RESULT", "OK");
            } else if (responseCode == ResponseCode.RESULT_USER_CANCELED) {
                Log.e("RESULT", "CANCEL");
            } else {
                Log.e("RESULT", "ERROR");
            }
        }

        @Override
        public void onRestoreTransactionsResponse(RestoreTransactions request,
                ResponseCode responseCode) {
            // TODO Auto-generated method stub
            Log.e("method", "onRestoreTransactionsResponse");
        }

    }

    private QuestionsPurchaseObserver mObserver;
    private Handler mHandler;
    private BillingService mBillingService;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.upgrade);

        initialize();

        mHandler = new Handler();
        mObserver = new QuestionsPurchaseObserver(mHandler);
        mBillingService = new BillingService();
        mBillingService.setContext(this);

        ResponseHandler.register(mObserver);
        if (!mBillingService.checkBillingSupported()) {
            Toast.makeText(this, "Paying isn't support", Toast.LENGTH_LONG).show();
        }
    }

    private void initialize() {

        Button bronze=(Button)findViewById(R.id.buttonBuyBronze);
        Button silver=(Button)findViewById(R.id.buttonBuySilver);
        Button gold=(Button)findViewById(R.id.buttonBuyGold);

        bronze.setOnClickListener(this);
        silver.setOnClickListener(this);
        gold.setOnClickListener(this);
    }

    @Override
    public void onClick(View view) {

        if (mBillingService.requestPurchase("bronze_q", null)) {

            Log.e("1", "bronze yes");
        }
        else {

            Log.e("1", "bronze no");
        }
    }

    @Override
    protected void onStart() {
        super.onStart();
        ResponseHandler.register(mObserver);
    }

    @Override
    protected void onStop() {
        super.onStop();
        //ResponseHandler.unregister(mObserver);
    }
}
</code></pre>

<p>The window for paying is shown sucessfully, but I have problem - if I close this window than I don't get any events in onRequestPurchaseResponse method. Where have I made mistake? Thank you. </p>
