Skip to content Skip to sidebar Skip to footer

How To Pass Id With Url While Requesting?

loginpage.java this is my activity for login page. i am using this json for it {'status':'success','msg':'Your are now Login Successfully','user_login_id':2650}. here i am getting

Solution 1:

I just suggest you to use SharedPreference for this. When you get Login response, just parse the JSON and then get log_in_id field value and save it in SharedPreferences, then whenever you want to use this value you can use throughout your application.

Solution 2:

you already used the same method in your doInBackground : here is a suggested edit to prepare it for the next:

  1. add "user_login_id" to params list
  2. change POST to GET if it is so.

    protected String doInBackground(String... args) { // Building Parameters List params = new ArrayList();

    params.add(new BasicNameValuePair("version", "apps"));
    
        // add the user_login_id to params.params.add(new BasicNameValuePair("user_login_id ", "265"));
        // getting JSON string from URL // I think you are using GET bcz the url shows the parameters.
        String json = jsonParser.makeHttpRequest(MATCH_URL, "GET",
                params);
    

Post a Comment for "How To Pass Id With Url While Requesting?"