Calling startIntentSenderForResult from Fragment (Android Billing v3)

前端 未结 11 1096
广开言路
广开言路 2020-11-29 02:46

The new Android Billing v3 documentation and helper code uses startIntentSenderForResult() when launching a purchase flow. I want to start a purchase flow (and

11条回答
  •  有刺的猬
    2020-11-29 03:30

    You need to call

    super.onActivityResult(requestCode, resultCode, data);
    

    at the beginning of your Activity's and Fragment's onActivityResult to cascade the Results to the fragments.

    In my FragmentActivity this reads as

    @Override
    public void onActivityResult(int requestCode, int resultCode, Intent data) {
        // No action here, call super to delegate to Fragments
        super.onActivityResult(requestCode, resultCode, data);
    }
    

提交回复
热议问题