In my app i need to open the bank's page, to make the user able to pay.
Reading the Android documentation I see that I should use an ACTION_VIEW
(and not a WebView) to accomplish this.
Uri uri = Uri.parse("http://www.example.com");
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
startActivity(intent);
My question is: After the user is done with the payment, how can i get back to the app?
I mean, I'd like to do something like
startActivityForResult(intent, RESULT_CODE);
to open the bank's site, and then get back to the app when the user is done, using the
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
callback to handle the result of the payment.
And, am I following the right way? Or is there any other way to accomplish this?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…