question

sanjay avatar image
sanjay asked ·

When starting application intent from Payment connectors onSaleResponse method we found java.lang.IllegalStateException: App switches blocked when starting Intent

@justin.a @keithryanwong @Greg @Jeffrey Blattman
Hi,
I am facing an issue with Sale request via Payment connector with the following code:
SaleRequest request = new SaleRequest();
request.setExternalId(ExternalIdUtils.generateNewID());
request.setAmount(paymentAmount);
request.setOrderId(mOrderId);
request.setCardEntryMethods(Intents.CARD_ENTRY_METHOD_ALL);
request.setTipAmount(DEFAULT_TIP);
request.setTipMode(TipMode.TIP_PROVIDED);
request.setDisablePrinting(true);
request.setDisableReceiptSelection(true); //I want to open my receipt selection screen thats why we are disabling it.
request.setDisableDuplicateChecking(true);
mPaymentConnector.sale(request);

I want to start own receipt selection screen via Intent. So when we start own activity: onSaleResponse(final SaleResponse response){
//Start own activity
}
It throughs following exception:
java.lang.IllegalStateException: App switches blocked when starting Intent

If we start own activity after 10 seconds of response, it works fine. But we don't want to show own receipt section screen after 10 seconds, I want to show immediately.

Please suggest us the solution for it.

I am using the following dependencies:
implementation group: 'com.clover.sdk', name: 'clover-android-sdk', version: '215'implementation group: 'com.clover.sdk', name: 'clover-android-connector-sdk', version: '215'
semi-integrationsPaymentConnector
1 comment
10 |2000 characters needed characters left characters exceeded

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

Hi Clover- We are experiencing the same issue in our ShopKeep register. Were you able to determine any cause for this?

Thanks,

Keith

0 Likes 0 · ·

0 Answers

Welcome to the
Clover Developer Community