0
 protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_login);
    activity = this;
    mContext = getApplicationContext();
    util = new Login_Utils(mContext, activity);

    Intent intent = getIntent();
    url = intent.getExtras().getString("url");

    webView = (WebView)findViewById(R.id.webview_Login);
    webView.setWebViewClient(new WebViewClient(){

        @Override
        public boolean shouldOverrideUrlLoading (WebView view, String url) {

            return false;
        }


        public void onPageFinished(WebView view, String urlConnection){

        }
    });
    webView.loadUrl(url);

}

My app has 2 types of login. 1. create account in the app and login 2. login with well-known website (facebook, etc....)

If I tried to login with the method 2, the webview shows the login screen of the website. (all work needed to implement login mechanism is done in server side)

If the id and password are match, the server give back some information as a json format.

So, I want to get json object.

심희수
  • 123
  • 1
  • 2
  • 5

1 Answers1

-1

Le t me try to explain you. If you are calling ur URL then you can get a response like this: How can I get the JSON response of a POST request in a WebView? Check it and try with shouldOverrideUrlLoading method of WebViewClient. Maybe it will help you

Community
  • 1
  • 1
Siddhpura Amit
  • 67
  • 2
  • 10