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 6612559
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T20:06:47+00:00 2026-05-25T20:06:47+00:00

I am working in android. i want to make a custom dialog in which

  • 0

I am working in android. i want to make a custom dialog in which i want to add a paypal button.

this is the code for my program:-

public class CustomizeDialog extends Dialog implements OnClickListener {
Button close;
String TAG="CustomizeDialog";

Context customize_dialog;

CheckoutButton launchSimplePayment;

public CustomizeDialog(Context context,String title_of_song,String artist_of_song,float price_of_song) {
    super(context);

    customize_dialog=context;

    setContentView(R.layout.paypal_custom_dialog);


    close = (Button) findViewById(R.id.paypal_close);


    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) {

    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);

               startActivityForResult(checkoutIntent, 1); **//this line is creating error that startActivityForResult() is undefined for type CustomizeDialog** 

    }



}

are we not apply CustomizeDialog() for a activity which is extending Dialog ? (as i done in my this program)
please suggest me what should i do for this ?
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-25T20:06:48+00:00Added an answer on May 25, 2026 at 8:06 pm

    You can use the Activity whose theme is Dialog. This way you can achieve startActivityForResult as well as make it look like Dialog.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some code which is working in iphone and i want to make
I am working in android . I want to make sharedpreference in my code,
I am working in android, i want to make a scrollview. this is my
i am working in android. I want to make TabHost and Tab widget. this
I am working on android apps. I want to add a contact in android
I'm working on books library in my android app... so I want to add
I'm working on an Android application which can make internet phone calls. I got
I want to make a page for android which is refreshing in every sec
I want to make a http request with android. is use this: void testHTTP()
I just started working on a new Eclipse Android project and want to make

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.