Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6698367
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T06:34:10+00:00 2026-05-26T06:34:10+00:00

I am working in android. i am designing a custom dialog in which there

  • 0

I am working in android. i am designing a custom dialog in which there are two buttons one for close and one for paypal. whenever i press paypal button, this program terminated.

this is my code:-

public class CustomizeDialog extends Dialog implements OnClickListener {

    Button close;

    String TAG="CustomizeDialog";



    Context customize_dialog;

    CheckoutButton launchSimplePayment;

    public CustomizeDialog(Context context) {
        super(context);
        /** It will hide the title */
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        customize_dialog=context;
        setContentView(R.layout.paypal_custom_dialog);
        close = (Button) findViewById(R.id.paypal_close);
        text_view_price.setText("Price : "+price_of_song);

        PayPal pp = PayPal.getInstance();
        if (pp == null) {
            try {
                pp = PayPal.initWithAppID(context, "", PayPal.ENV_NONE);
            } catch (IllegalStateException e) {
                throw new RuntimeException(e);
            }
            pp.setShippingEnabled(false);
        }




        launchSimplePayment = pp.getCheckoutButton(context,

        PayPal.BUTTON_118x24, CheckoutButton.TEXT_PAY);

        LinearLayout lnr = (LinearLayout) findViewById(R.id.Paypal_Custom_Dialog_View);


        launchSimplePayment.setOnClickListener( this);


        lnr.addView(launchSimplePayment);




        close.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        Log.v(TAG, "i am closing tag");
        if (v == close)
            dismiss();
        if(v==launchSimplePayment)
        {
            dismiss();
            PayPalPayment payment = new PayPalPayment();

            payment.setSubtotal(new BigDecimal("2.25"));

            payment.setCurrencyType("USD");

            payment.setRecipient("kuntal_1316186174_biz@gmail.com");

            payment.setPaymentType(PayPal.PAYMENT_TYPE_GOODS);

            Intent checkoutIntent = PayPal.getInstance().checkout(payment,customize_dialog);

            ((Activity) customize_dialog).startActivityForResult(checkoutIntent, 1);
        }



    }


}

please check the code and point out what mistake i have done ?
Thank you in advance…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T06:34:11+00:00Added an answer on May 26, 2026 at 6:34 am

    This is the solution for the problem:-

    @Override
    public void onClick(View v) {
    Log.v(TAG, “i am closing tag”);
    if (v == close)
    dismiss();
    if(v==launchSimplePayment)
    {

            PayPalPayment payment = new PayPalPayment();
    
            payment.setSubtotal(new BigDecimal("2.25"));
    
            payment.setCurrencyType("USD");
    
            payment.setRecipient("kuntal_1316186174_biz@gmail.com");
    
            payment.setPaymentType(PayPal.PAYMENT_TYPE_GOODS);
    
            Intent checkoutIntent = PayPal.getInstance().checkout(payment,customize_dialog);
    
            ((Activity) customize_dialog).startActivityForResult(checkoutIntent, 1);
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We're designing an Android app that has several activities which are working in a
i am working in android. i am designing an application which is based on
I'm working on an Android app in which I would like to use multi-touch.
I am now working on a program for Android which is something related to
I've been working with Android's TTS functions with general success however, one piece of
I am working on designing an Android application, and I have several questions I
I was working on an android project, and while designing i noticed something strange
I am working on android development, I need a good UI designer which is
I'm working on android app development in which how get profiling information like Data
i am working in android. i want to call a number which is displaying

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.