11

手順は次のとおりです。

  1. InApp V3 サンプルの Trivial Drive の例をビルドして実行する
  2. 購入オプションを選択
  3. 戻るボタンを押す
  4. もう一度購入してみる

2013年1月現在のバージョンでは

別の非同期操作 (launchPurchaseFlow) が進行中のため、非同期操作 (launchPurchaseFlow) を開始できません。

次に、アプリケーションを強制終了しない限り、非同期フラグがクリアされないため、IabHelper クラスの購入または在庫メソッドを使用できません。

考えられる解決策は次のとおりです。

flagEndAsync メソッドを public にして、onRestart メソッドで呼び出しました。質問は次のとおりです。これは安全な解決策ですか? そして、他の誰かがこの問題を見ましたか?

ここに私が追加したものがあります:

protected void onRestart() {
    super.onRestart();
    if (mHelper != null) mHelper.flagEndAsync();
}
4

1 に答える 1

37

次のコードを削除していませんか (またはアクティビティに追加するのを忘れていましたか)?

@Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        // Pass on the activity result to the helper for handling
        if (!mHelper.handleActivityResult(requestCode, resultCode, data)) {
            // not handled, so handle it ourselves (here's where you'd
            // perform any handling of activity results not related to in-app
            // billing...
            super.onActivityResult(requestCode, resultCode, data);
        }
    }
于 2013-01-21T13:58:07.627 に答える