jeudi 19 juillet 2018

why my new service displayes nothing?

I work on a small project frontend android e backend laravel .. I have a listview linked to a database mysql, at the beginning all works well, when I changed my new url, nothing is displayed whatever I do and no error is displayed .. how can i do please !!

this is my code

 public GetHttpResponse(Context context)
    {
        this.context = context;
    }

    @Override
    protected void onPreExecute()
    {
        super.onPreExecute();
    }

    @Override
    protected ArrayList<subjects> doInBackground(String... arg0)
    {
        HttpServicesClass httpServiceObject = new 
    HttpServicesClass(arg0[0]);
        ArrayList<subjects> subjectsList = new ArrayList<subjects>();
        try
           {
            httpServiceObject.ExecutePostRequest();
            if(httpServiceObject.getResponseCode() == 200)
            {
                ResultHolder = httpServiceObject.getResponse();
                if(ResultHolder != null)
                {
                    JSONArray jsonArray = null;
                    try {
                        jsonArray = new JSONArray(ResultHolder);
                        JSONObject jsonObject;
                        subjects subjects;
             for(int i=0; i<jsonArray.length(); i++)
                        {
                            subjects = new subjects();
                           jsonObject = jsonArray.getJSONObject(i);
                           if(valueInteger == 
         jsonObject.getInt("tache_id") )
                            {
                                 subjects.avis = 
         jsonObject.getDouble("avg_avis_intervention");

         subjects.nom=jsonObject.getString("nom");
                                  subjects.SubjectName = 
         jsonObject.getDouble("tarif");
                                //  subjects.technicien_id = 
         jsonObject.getString("technicien_id");
                                   subjectsList.add(subjects);

                    }}}
                    catch (JSONException e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                    }
                }
            }
        }
        catch (Exception e)
        {
        }
        return subjectsList;
    }

and my new JSON output

[
{
    "nom": "teck",
    "tache": 2,
    "tarif": 100,
    "avg_avis_interventions": null
}]



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire