我正在开发具有静态应用内产品 ID 的 android 应用内应用程序:android。测试。购买的效果很好,我还收到了 Toast 消息:谢谢。您的商品很快就会出现。但在实际产品 ID:com.android.example 无法正常工作。我不知道 toast 消息类现在我该怎么办。
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);
mainview=(ImageView)findViewById(R.id.comcontractsol);
mBillingObserver = new AbstractBillingObserver(this) {
@Override
public void onBillingChecked(boolean supported)
{
Dungeon.this.onBillingChecked(supported);
}
@Override
public void onPurchaseStateChanged(String itemId, PurchaseState state)
{
if(itemId.equals("android.test.purchased"))
{
mainview.setBackgroundResource(R.drawable.unlock);
Dungeon.this.onPurchaseStateChanged(itemId, state);
startActivity(new Intent(getApplicationContext(), secondActivity.class));
}
}
@Override
public void onRequestPurchaseResponse(String itemId, ResponseCode response)
{
Dungeon.this.onRequestPurchaseResponse(itemId, response);
}
}