Why paypal integration is not working?
<p>I have been integrate paypal in my android application but it is not working .
   there is a button on click of that button move to paypal where ask for pay onclick of paypal buttom seldom login screen open seldom not and when click login screen open after input login record message shows login fail please anyone see this where I am wrong my code is this:-</p>

<pre><code>private LinearLayout mainLayout = null;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    System.out.println("inside");
    callPayment();
    setContentView(mainLayout);
}

private void initializePayPal()
{

}
private void callPayment()
{
     mainLayout= new LinearLayout(this);
    PayPal mpaypal = PayPal.initWithAppID(this, "APP-80W284485P519543T", PayPal.ENV_SANDBOX); 
    LinearLayout layoutSimplePayment = new LinearLayout(this);

    layoutSimplePayment.setLayoutParams(new LayoutParams(130,100));

    layoutSimplePayment.setOrientation(LinearLayout.VERTICAL);
    CheckoutButton getpaypalbutton =mpaypal.getPaymentButton(PayPal.BUTTON_152x33,this,PayPal.PAYMENT_TYPE_HARD_GOODS);
    getpaypalbutton.setOnClickListener(this);

    layoutSimplePayment.addView(getpaypalbutton);

    mainLayout.addView(layoutSimplePayment);
}

@Override
public void onClick(View v) 
{
    PayPalPayment mpaypalpayment = new PayPalPayment();
    mpaypalpayment.setAmount(0.2f);
    mpaypalpayment.setCurrency("USD");
    mpaypalpayment.setRecipient("xyz@gmail.com");
    mpaypalpayment.setItemDescription("mother board");
    mpaypalpayment.setMerchantName("BidNear");
    Intent checkoutIntent = new Intent(this, PayPalActivity.class);
    checkoutIntent.putExtra(PayPalActivity.EXTRA_PAYMENT_INFO, mpaypalpayment);
    this.startActivityForResult(checkoutIntent, 1);
}

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data)
{
    switch(resultCode) {
    case Activity.RESULT_OK:
    //The payment succeeded
    String transactionID = data.getStringExtra(PayPalActivity.EXTRA_TRANSACTION_ID);
    //Tell the user their payment succeeded
    //Tel break;
    Toast.makeText(this,"Success"+transactionID,Toast.LENGTH_LONG).show();

    case Activity.RESULT_CANCELED:
    //The payment was canceled
    //Tell the user their payment was canceled
    break;
    case PayPalActivity.RESULT_FAILURE:
    //The payment failed -- we get the error from the EXTRA_ERROR_ID and EXTRA_ERROR_MESSAGE
    String errorID = data.getStringExtra(PayPalActivity.EXTRA_ERROR_ID);
    String errorMessage = data.getStringExtra(PayPalActivity.EXTRA_ERROR_MESSAGE);
    Toast.makeText(this,"Failure"+"errorid"+errorID+"errormessage"+errorMessage,Toast.LENGTH_LONG).show();
    //Tell the user their payment was failed.
    }
}
</code></pre>
