question

Lee Tickett avatar image
Lee Tickett asked Lee Tickett answered

com.clover.sdk.v1.BindingException: Could not bind to Android service

Im convinced the code is the same as our other working apps, but this one is throwing an error;
final Context context = this;
AccountData.sCloverAccount = CloverAccount.getAccount(context);
new AsyncTask<Void, Void, Void>() {

    @Override
    protected Void doInBackground( Void... voids ) {
        try {
            MerchantConnector merchantConnector = new MerchantConnector(context, AccountData.sCloverAccount, null);
            merchantConnector.connect();
            Log.d("", merchantConnector.getMerchant().getId());
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }
}.execute().get();
Any ideas?
Thanks
Clover Android SDKMerchant
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

Lee Tickett avatar image
Lee Tickett answered
Figured it out for anyone that's interested. Exactly the same code but instead of;
.execute().get();
Doing;
.execute();
Works.
Now I need to find a better way to ensure correct code flow.
10 |2000

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