question

preeyaa avatar image
preeyaa asked thiko answered

close clover sales app and return to my app

I am building an app using kotlin in android studio which is mainly used to scan the QR code. Once the QR code is scanned successfully then clicking on proceed to pay button on my app will open the clover sales app . After the transaction is completed in the sales app . I want to close the clover sales app(programmatically) and return to my app.

I am able to open the clover sales app using intend(the code is attached below). But, I am quite stuck to close the clover sales app(programmatically) and return to my app .

So, Could anyone please guide me how to achieve that? Does anyone have any idea of how can I be sure to go back to application A when application B is over ?


   '  private fun openCloverSalesApp(amountInCents: Long) {
     val packageManager: PackageManager = packageManager 
    val intent = packageManager.getLaunchIntentForPackage(CLOVER_SALES_PACKAGE) 
    if (intent != null) {
        try {
            intent.putExtra("CustomerId", customerId.toString())
            intent.putExtra(Intents.EXTRA_AMOUNT, amountInCents) 

       // Launch the Clover Sales app
            startActivity(intent)

        
    } else {
        // Show an error message if the Clover Sales app is not installed
        Log.e("CloverSales", "Clover Sales app not found")
    }
}'


Clover Android SDKClover Flex
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
thiko avatar image
thiko answered

Superb post!

10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Welcome to the
Clover Developer Community