How can I go to next activity after Login is successful in android studio using php Mysql. This is my login activity code

Viewed 17

**This is my login activity. I want of link a intent home.class so that once login is successful my activity switch to home.class from login page **

''' @Override

    protected JSONObject doInBackground(String... args) {



        String email = args[2];
        String password = args[1];
        String name= args[0];

        ArrayList params = new ArrayList();
        params.add(new BasicNameValuePair("username", name));
        params.add(new BasicNameValuePair("password", password));
        if(email.length()>0)
            params.add(new BasicNameValuePair("email",email));

        JSONObject json = jsonParser.makeHttpRequest(URL, "POST", params);


        return json;

    }

    protected void onPostExecute(JSONObject result) {

        // dismiss the dialog once product deleted
        //Toast.makeText(getApplicationContext(),result,Toast.LENGTH_LONG).show();

        try {
            if (result != null) {
                Toast.makeText(getApplicationContext(),result.getString("message"),Toast.LENGTH_LONG).show();


            } else {
                Toast.makeText(getApplicationContext(), "Unable to retrieve any data from server", Toast.LENGTH_LONG).show();
            }
        } catch (JSONException e) {
            e.printStackTrace();
        }


    }
    


}

} ''' **kindly help me **

0 Answers
Related