0

Whenever I implement the MPL library in my Android project, the payment procedure person to person is OK. But after payment, they ask me for pincode insertion procedure. After inserting pin code and mobile number against my account we are facing "unfortunately close" with below error:

com.paypal.MobilePayments.Pizza,PID 15556
android.view.ViewRootImpl$CalledFRomWrongThreadExcpetion: Only the original thread created a view hierarchy can touch it's view.
android.view.ViewRootImpl.checkThread(ViewRootImpl.java:6745)

What am I doing wrong?

AstroCB
  • 12,337
  • 20
  • 57
  • 73

1 Answers1

0

You have to use that code in runOnUiThread like this.You have to run that method in main thread.

runOnUiThread(new Runnable() {
                    @Override
                    public void run() {
                        //Your code here
                    }
                });
  • Thats the only issue that causes this error.Nothing else can cause this error thats for sure. –  Apr 01 '15 at 05:37
  • Basically we find it in paypal integration(MPL Library). Please help me out. – tara_android_programmer Apr 01 '15 at 05:39
  • Thats not the library error,you can check [other posts](http://stackoverflow.com/questions/5161951/android-only-the-original-thread-that-created-a-view-hierarchy-can-touch-its-vi) and their answers. –  Apr 01 '15 at 05:42
  • Yes,as you are saying it's correct. If You check with developer code [paypal](https://developer.paypal.com/webapps/developer/docs/classic/mobile/gs_MPL/), you can get same thing as you previously told. Any how i have to find a way. Let's see, how i can!! – tara_android_programmer Apr 01 '15 at 05:53