android - 为什么我的新服务什么都不显示?
问题描述
我正在做一个小项目,前端使用 android,后端使用 laravel。我有一个listview
链接到 mysql 数据库。最初,这一切都运作良好。但是,当我更改为新 URL 时,无论我做什么都不会显示任何内容,也不会显示错误。我怎样才能解决这个问题?这是我的代码:
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;
}
和我的新 JSON 输出
[
{
"nom": "teck",
"tache_id": 2,
"tarif": 100,
"avg_avis_interventions": null
}
]
解决方案
推荐阅读
- matlab - 用 Matlab 切割树状图
- java - 在intellij中调试tomcat过滤器链
- select - 如何在从角度材料选择下拉列表中选择值时显示按钮
- apache-spark-sql - Spark 单机版 v 2.3.2 测试失败
- django - 如何在 django oscar 中打印产品的零售价和成本价?
- vba - VBA多选项对话框输出
- excel - 使用 SPLIT 函数将数字列表与用户表单分开
- list - 如何通过引用将列表传递给 Cmake 函数
- javascript - 如何将我的 jwt 设置为 cookie 以防止在刷新时登录?
- apache-spark - Elasticsearch Spark,如何多次查询?