Well we can't help you without having much information.So instead I'll try to do a checklist for you in case you missed something:
Are you testing on an emulator?Billing services should be tested on devices,BUT if you
really have to test on the emulator,make sure the emulator has google play installed and set up.This is very important!
Did you set the correct permission in the manifest? (com.android.vending.BILLING)
If you are still testing the app,did you get a test app licence from the playstore, imported the level in your SDK ,set up your licence verification library? (you can follow along here: setting up
On your activity onActivityResult did you correctly handle the activity result?As seen on the example from google you should do it this way:
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data)
{
Log.i(TAG, "onActivityResult(" + requestCode + "," + resultCode + "," + data);
// Pass on the activity result to the helper for handling
if (!inappBillingHelper.handleActivityResult(requestCode, resultCode, data)) {
super.onActivityResult(requestCode, resultCode, data);
}
else {
Log.i(TAG, "onActivityResult handled by IABUtil.");
}
}
Also having more information could be useful, like if you are testing on the emulator or device, the device name, the android version etc...
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…