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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T11:05:20+00:00 2026-06-08T11:05:20+00:00

The following shows my code used to initialize a paypal object in my android

  • 0

The following shows my code used to initialize a paypal object in my android app.
Runtime error is resulted from doInBackground() so i think it is probably due to false returned by payPal.isLibraryInitialized().

Do you guys have experience on paypal integration in android app?

private class PayPalInitializer extends AsyncTask<Void, Void, Boolean> {

    private static final String APP_ID = "APP-80W284485P519543T";
    private Context mContext;
    private ProgressDialog mProgressDialog;

    public PayPalInitializer(Context context) {
      mContext = context;
    }

    @Override
    protected void onPreExecute() {
      super.onPreExecute();
      mProgressDialog = new ProgressDialog(mContext);
      mProgressDialog.setMessage("...");
      mProgressDialog.show();
    }

    @Override
    protected Boolean doInBackground(Void... params) {
      boolean success = false;
      PayPal payPal = PayPal.getInstance();
      if (payPal == null) {
        payPal = PayPal.initWithAppID(mContext, APP_ID, PayPal.ENV_SANDBOX);
        payPal.setFeesPayer(PayPal.FEEPAYER_EACHRECEIVER);
        // Set to true if the transaction will require shipping.
        payPal.setShippingEnabled(true);
        if (payPal.isLibraryInitialized()) {
          success = true;
        }
      }
      return success;
    }

    @Override
    protected void onPostExecute(Boolean result) {
      super.onPostExecute(result);
      mProgressDialog.hide();
      mProgressDialog = null;
      if (result) {
        setupButton();
      } else {
        Toast.makeText(getApplicationContext(), "", Toast.LENGTH_SHORT).show();
      }
    }
  };
  • 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-08T11:05:21+00:00Added an answer on June 8, 2026 at 11:05 am

    This type of error occurs if you have added jar file but it is not included properly.Right click on your project and then go to properties–java build path–order and export.There check if checkbox beside the jar.It should be checked.run your app again and check if same issue exists.

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

Sidebar

Related Questions

Currently, the following code shows a blank line if Address2 (which comes from the
Consider the following code which shows compile time error : #include <stdio.h> int main(int
following code is used to find url from a string with php. Here is
I'm using a Android Wildfire and I used the following code to lookup the
I have used the code from here in my app, when I click on
The following code shows a button that allows you to select a file (should
The following code shows 1 view, 1 partial view, and 1 controller . The
The following code shows what I currently have. It is an adapter for circular
The following code with alternating background I have shows up fine in Chrome and
In the following code every time button is clicked the alter shows the value

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.