Webview error on loginwithfacebook() Android

Im running an app with a webview, so if i want use loginwithfacebook() to create a popup login, android trhows the next error:

android.view.ViewRootImpl$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.

The error you’re getting is self-explanatory. If you just try googling it, you’d find plenty of answers. For example this one:

I had searched google , but I thought that the error should be corrected within the SDK , but worked perfectly , thanks !!