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

  • Home
  • SEARCH
  • 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 8632397
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T09:20:49+00:00 2026-06-12T09:20:49+00:00

I’m doing paypal payment for that i have to run thread in onCreate() method

  • 0

I’m doing paypal payment for that i have to run thread in onCreate() method which initializes Button with Paypal image i’m calling one function from it which validates above fields then fires an API, if user oes wrong Toast is appeared that ” … this filed not be blanck.” but after this when i correct that field and again click on Btn then it does nothing.

Thread libraryInitializationThread = new Thread() {
            public void run() {


                initLibrary();

                // The library is initialised so let's create our CheckoutButton
                // and update the UI.
                if (PayPal.getInstance().isLibraryInitialized()) {

                    runOnUiThread(new Runnable() {
                        public void run() {
                            /**
                             * Create our CheckoutButton and update the UI.
                             */
                            PayPal pp = PayPal.getInstance();

                            /**
                             * Get the CheckoutButton. There are five
                             * differentsizes. The text on the button can either
                             * be of type TEXT_PAY or TEXT_DONATE.
                             **/
                            launchChainedPaymentBtn = pp.getCheckoutButton(
                                    BuyDeal.this, PayPal.BUTTON_194x37,
                                    CheckoutButton.TEXT_PAY);

                            /**
                             * You'll need to have an OnClickListener for the
                             * CheckoutButton. For this application, MPL_Example
                             * implements OnClickListener and we have the
                             * onClick() method below.
                             **/
                            launchChainedPaymentBtn
                                    .setOnClickListener(new OnClickListener() {

                                        @Override
                                        public void onClick(View v) {

                                            // dealResponse
                                            getDealResponseLogic();

                                        }
                                    });
                            //
                            BottomBtnsLinearLayout
                                    .addView(launchChainedPaymentBtn);
                            Log.v("Btn added ", "SuccessFully...");
                            Flag = true;
                        }
                    });
                    //
                    //
                    BottomBtnsLinearLayout.addView(launchChainedPaymentBtn);
                    Log.v("Btn added ", "SuccessFully...");
                    // }
                    // });

                    Log.i("Lib. initialized", "now...");

                    /** Calling Thread to add Btn to It! **/
                    AddPayPalBtn.start();

                } else {

                    Log.i("Cannot Initialize Payment Btn",
                            "setAPyment Btn..failed due to Lib. initialization..");
                }

            }

        };
        libraryInitializationThread.start();

I called above thread in onCreate() method of my activity.

code for dealResponseLogic() only deals with validation.

initLibrary(); It get PayPal instance make use of internet and then set some fields of that instance.

I know that i can call to that thread from that btn Listener code btn i’m looking for another way.

Please… any help will be appreciated…

  • 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-06-12T09:20:49+00:00Added an answer on June 12, 2026 at 9:20 am

    I think it’s pretty easy. While using paypal you have to create button using paypal, so there is one method provided by paypal to update that button i.e. updateButton() you just want to call that method.
    So, your button works fine everytime you click .

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am doing a simple coin flipping experiment for class that involves flipping a
I have a French site that I want to parse, but am running into
I would like to run a str_replace or preg_replace which looks for certain words
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have an autohotkey script which looks up a word in a bilingual dictionary
I have an array which has BIG numbers and small numbers in it. I
I have a text area in my form which accepts all possible characters from
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
I am trying to understand how to use SyndicationItem to display feed which is

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.