> ## Documentation Index
> Fetch the complete documentation index at: https://razorpay-60c89f9a-mintlify-audit-missing-sections-1778528421.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# UPI Intent Flow for Android SDK

> Use the Android SDK to support UPI Intent payments when a payment is processed through Razorpay in a WebView inside an app.

## Installation

Download the JAR file and include it in the `libs` folder.

## Initialization

To initiate the SDK, call the Razorpay class constructor in your project and pass `key` as Razorpay API key and `webView` as the object that handles the payment flow.

````java: Java theme={null}
import com.razorpay.Razorpay

Razorpay razorpay = new Razorpay(key, webView, activity);
```java: Kotlin
import com.razorpay.Razorpay;

val razorpay = Razorpay(key, webview, activity)
````

### Passing the Result to Razorpay

After UPI is selected as the payment method, Razorpay invokes the *Intent Flow* page that lists all the available intent flows for the user to select and make the payment. Upon payment completion, the UPI app returns the result back to your `activity` in `onActivityResult` method. This should be passed to Razorpay as shown below:

````java: Java theme={null}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    if (requestCode == Razorpay.UPI_INTENT_REQUEST_CODE) {
        razorpay.onActivityResult(requestCode, resultCode, data);
    }
}
```java: Kotlin
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
    super.onActivityResult(requestCode, resultCode, data)
    if (requestCode == Razorpay.UPI_INTENT_REQUEST_CODE) {
        razorpay.onActivityResult(requestCode, resultCode, data)
    }
}
````
