[英]Error for json Service String cannot be converted to JSONObject
if (json.getString(itfdata) != null ) {
String itfdata = json.getString("itfdata");
Log.d("Json Response itfdata is--->","" + itfdata.toString());
}
try {
JSONArray array = new JSONArray(itfdata.toString());
//JSONArray array = new JSONArray(itfdata.toString());
for (int i = 0; i < array.length(); i++) {
list.add(array.getString(i));
System.out.println("I Position : " + array.getString(i));
}
} catch (JSONException e) {
e.printStackTrace();
}
确保您的地址包含https
否则您将得到302 Found
,告诉您重定向到https endpoing。
您的网址应为:
https://www.fitindya.in/windex.php?itfpage=cat_post&id=5
并不是
http://www.fitindya.in/windex.php?itfpage=cat_post&id=5
例如,您可以做的是
String strUrl = getUrlData.replace("http://","https://")+"windex.php?itfpage=cat_post&id="+id;
您还需要在链接上添加“ www”。
if(!strUrl.contains("https://www."))
strUrl.replace("https://","https://www.");
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.