Loading dialog

Show the supplied Lib Lite progress dialog while you create a code on your backend — for visual consistency with the payment flow.

The Lib Lite SDK ships with a LibLiteLoading progress dialog you can show during the gap between "customer tapped Pay" and "SDK activity launches." Most commonly, you'll show it while your backend creates a transaction code.

The dialog is themed to match the rest of the SDK UI, so the customer doesn't see a styling jump between your loader and the SDK's screens. Using it is optional.


When to use it

ScenarioUse the dialog?
You're creating a code server-side after Pay was tappedYes
You're doing other async work before launching the SDKYes
You already have your own loader styled to matchUp to you — pick one
The code is already on handNo — launch directly

Show the dialog

LibLiteLoading loadingDialog = new LibLiteLoading();
loadingDialog.show(getSupportFragmentManager(), null);

The dialog is a DialogFragment — manage its lifecycle the standard way.


Dismissing

The dialog dismisses automatically when LibLiteActivity launches (the activity transition cancels the dialog's fragment manager state). You can also dismiss explicitly:

loadingDialog.dismiss();

Putting it together

A typical "create code, then pay" flow:

payButton.setOnClickListener(v -> {
    // 1. Show the loader
    LibLiteLoading loadingDialog = new LibLiteLoading();
    loadingDialog.show(getSupportFragmentManager(), null);

    // 2. Call your backend to create a code
    yourBackend.createCode(orderId, (code, error) -> {
        runOnUiThread(() -> {
            if (error != null) {
                loadingDialog.dismiss();
                showError("Couldn't start payment");
                return;
            }

            // 3. Launch Lib Lite — the dialog will fade as the activity opens
            Intent intent = new Intent(this, LibLiteActivity.class);
            intent.putExtra(LibLiteActivity.IN_CODE, code);
            intent.putExtra(LibLiteActivity.IN_API_KEY, "YOUR_API_KEY");
            intent.putExtra(LibLiteActivity.IN_HASH, "YOUR_SMS_HASH");
            intent.putExtra(LibLiteActivity.IN_SYSTEM, "LIVE");
            libLiteActivityLauncher.launch(intent);
        });
    });
});

What's next