【发布时间】:2020-03-18 11:01:45
【问题描述】:
我需要帮助。我无法在我的图像视图中加载图像;
它给了我以下信息: 日志猫:
2019-11-22 09:02:25.668 10976-10976 / com.acme.crazy W / ImageView: resolveUri 在错误的位图 uri 上失败: https://acme.com/storage/1/1234.png
提前致谢。
马古
public void load(){
url = "https://acme.com/webservices/json.php?idresp="+IdR+"&idinst="+IdI;
JsonObjectRequest request = new JsonObjectRequest(Request.Method.GET, url, null, new Response.Listener<JSONObject>() {
@Override
public void onResponse(JSONObject response) {
try {
JSONArray jsonArray = response.getJSONArray("list");
List<Map<String, String>> data = null;
data = new ArrayList<Map<String,String>>();
for (int i = 0; i < jsonArray.length(); i++) {
Map<String, String> datanum = new HashMap<String, String>();
JSONObject loginApp = jsonArray.getJSONObject(i);
datanum.put("A", loginApp.getString("IdA"));
datanum.put("B", loginApp.getString("IdI"));
datanum.put("C", "https://acme.com/storage/" + loginApp.getString("IdI") + "/" + loginApp.getString("Mat").trim() + ".png");
datanum.put("D", loginApp.getString("No"));
datanum.put("E", loginApp.getString("Ma"));
datanum.put("F", loginApp.getString("Se"));
datanum.put("G", loginApp.getString("Sa"));
Picasso.get().load(datanum.put( "H", "https://acme.com/storage/" + loginApp.getString("IdI") + "/" + loginApp.getString("Mat").trim() + ".png");
data.add(datanum);
}
String[] from = {"A", "B", "C", "D", "E", "F", "G", "H"};
int[] views = {R.id.tvA, R.id.tvB, R.id.tvC, R.id.tvD, R.id.tvE, R.id.tvF, R.id.tvG, R.id.ivSelImgH};
AD = new SimpleAdapter(SelectActivity.this, data, R.layout.activity_select_modelo, from, views);
lva.setAdapter(AD);
} catch (JSONException jse){
popDialog("Test", "Json Error" + jse.getMessage());
}
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
if (error instanceof TimeoutError || error instanceof NoConnectionError) {
popDialog("Tst", "This indicates that the reuest has either time out or there is no connection");
} else if (error instanceof AuthFailureError) {
popDialog("Tst", "Error indicating that there was an Authentication Failure while performing the request");
} else if (error instanceof ServerError) {
popDialog("Tst", "Indicates that the server responded with a error response :" + error.getMessage());
} else if (error instanceof NetworkError) {
popDialog("Tst", "Indicates that there was network error while performing the request");
} else if (error instanceof ParseError) {
popDialog("Tst", "Indicates that the server response could not be parsed");
}
}
});
mQueue.add(request);
}
【问题讨论】:
-
在服务器上没有找到图片我尝试了你的网址但是它给了我404错误,意味着没有找到数据。
-
我还没有发布应用程序的实际 url 非常感谢您的帮助。实际上我只有在加载图像时使用毕加索时遇到问题。谢了。
标签: android listview imageview picasso