Facebook log in from WebView

114 views Asked by At

`

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;

public class Vision2021 extends AppCompatActivity {

private WebView webView;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_vision2021);
    webView = (WebView)findViewById(R.id.W_View);
    WebSettings webSettings = webView.getSettings();
    webSettings.setJavaScriptEnabled(true);
    webView.loadUrl("http://vision2021.info/");
    webView.setWebViewClient(new WebViewClient());
}

@Override
public void onBackPressed() {
    if(webView.canGoBack())
    {
        webView.goBack();
    }
    else
    {
        super.onBackPressed();
    }

}
}

`I am trying to show a website in a simple android app by WebView. I already did it, but the problem is there is facebook login button in that website that does not work in WebView but it works in any browser. How can I log in from my pre-installed facebook app by that button of that site viewed in WebView.

0

There are 0 answers