card-io/card.io-Android-SDK

Doubt in adding card name function

Newuser30 opened this issue · 0 comments

General information

  • SDK/Library version:
  • Android Version and Device:

Issue description

Im using this library in my project. In that additionaly i add card number field. After entering card details press done . i set card name popup after pressing Done button. I set cardname popup with two buttons --> Cancel and Apply.

Here is java Code,

@OverRide
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);

    if (requestCode == MY_SCAN_REQUEST_CODE_NEW) {
        String resultDisplayStr;
        String cardNo = "", expMonth = "", expyear = "", cvv = "", cardholdername="";
        if (data != null && data.hasExtra(CardIOActivity.EXTRA_SCAN_RESULT)) {
           final CreditCard scanResult = data.getParcelableExtra(CardIOActivity.EXTRA_SCAN_RESULT);


            final Dialog dialog = new Dialog(PaymentCardList.this);
            dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
            dialog.setContentView(R.layout.cardname_dialog);

            final EditText edt_cardname=(EditText) dialog.findViewById(R.id.card_name_title_edittext);
            final TextView btn_apply=(TextView) dialog.findViewById(R.id.cardname_apply);
            final TextView btn_cancel=(TextView) dialog.findViewById(R.id.cardname_cancel);


            btn_apply.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {

                    if(edt_cardname.getText().toString().trim().length() == 0){
                        erroredit(edt_cardname, getResources().getString(R.string.card_dialog_empty_card_alert));
                    }else{
                        dialog.dismiss();
                        CardProcess(scanResult,edt_cardname.getText().toString());
                        System.out.println("********venki**paymentcardlist***scanResult**"+scanResult);

                        System.out.println("********venki**paymentcardlist***edt_cardname.getText().toString()***"+edt_cardname.getText().toString());
                    }

                }
            });


            btn_cancel.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    dialog.dismiss();
                    onScanPress();
                }
            });

            dialog.show();

               } else {

            resultDisplayStr = "Scan was canceled.";
        }

    }

}

Having Doubt In cancel button. When I press Cancel , dialog dismiss and move to the scan page. But How to move previous page. (ie) card details page.