gpt4 book ai didi

android - Android 中的循环 ImageView

转载 作者:行者123 更新时间:2023-11-29 18:11:17 26 4
gpt4 key购买 nike

我是 Android 开发新手,并且与 MySQL 数据库密切合作。目前,我正在开发一个 Android 项目,我想在其中循环 json 数据并将其转换为位图——我做到了,问题是显示图像我不断收到错误。

我已经发布了我的代码:

RequestQueue requestQueue = Volley.newRequestQueue(getApplicationContext());

JsonArrayRequest jsonArrayRequest = new JsonArrayRequest( Request.Method.GET, URL,null,
new Response.Listener<JSONArray>() {

@Override
public void onResponse(JSONArray response) {

int jsonLength = response.length();

// initialize new image object
final ImageView[] imageView = new ImageView[jsonLength];

// create new objects
imageView[jsonLength] = new ImageView(getApplicationContext());

try{


// Loop through the array elements
for(int i=0;i<=jsonLength;i++) {

// setting layout
final LinearLayout prodLayout = new LinearLayout(getApplicationContext());
prodLayout.setOrientation(LinearLayout.HORIZONTAL);
prodLayout.setPadding(40, 20, 20, 0);


JSONObject jsonData = response.getJSONObject(i);

// get json data
prodImageString = jsonData.getString("image");

// add components to layout
imageView[jsonLength].setMinimumWidth(89);
imageView[jsonLength].setMaxWidth(91);
imageView[jsonLength].setMinimumHeight(89);
imageView[jsonLength].setMaxHeight(91);

final String pureBase64Encoded = prodImageString.substring(prodImageString.indexOf(",") + 1);
byte[] decodeString = Base64.decode (pureBase64Encoded, Base64.DEFAULT);
Bitmap decoded = BitmapFactory.decodeByteArray (decodeString, 0, decodeString.length);
imageView[jsonLength].setImageBitmap(decoded);

prodLayout.addView(imageView[jsonLength]);

}

}catch (JSONException e){
Toast.makeText( getApplication(), e.getMessage().toString(), Toast.LENGTH_LONG).show();
}
}
},
new Response.ErrorListener(){
@Override
public void onErrorResponse(VolleyError error){
AlertDialog.Builder add = new AlertDialog.Builder(MainActivity.this);
add.setMessage(error.getMessage()).setCancelable(true);
AlertDialog alert = add.create();
alert.setTitle("Error!!!");
alert.show();
}
});

// Add JsonArrayRequest to the RequestQueue
requestQueue.add(jsonArrayRequest);
}

此外,我不断收到以下有关索引的错误:

E/AndroidRuntime: FATAL EXCEPTION: main
Process: lagecy.live.desh.com.shoppincarttest, PID: 7430
java.lang.ArrayIndexOutOfBoundsException: length=37; index=37
at lagecy.live.desh.com.shoppincarttest.MainActivity$1.onResponse(MainActivity.java:67)
at lagecy.live.desh.com.shoppincarttest.MainActivity$1.onResponse(MainActivity.java:56)
at com.android.volley.toolbox.JsonRequest.deliverResponse(JsonRequest.java:65)
at com.android.volley.ExecutorDelivery$ResponseDeliveryRunnable.run(ExecutorDelivery.java:99)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6119)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)

示例 Json 数据

[{
"image": "data:image/octet-stream;base64,/9j/4AAQSkZJRgABAQEASABIAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAARCAFAAUADASIAAhEBAxEB/8QAHAABAAIDAQEBAAAAAAAAAAAAAAUGAwQHAQII/8QARBAAAQQBAgQDBQUFBAkFAQAAAQACAwQRBSEGEjFBE1FhBxQicZEyQoGhsRUjUsHRJENichYzNFNUY6Lh8DZEdJKy8f/EABsBAQADAQEBAQAAAAAAAAAAAAADBAUCAQYH/8QANBEAAgICAAQCCQQCAgMBAAAAAAECAwQRBRIhMUFREyJhcYGRobHRBjLB8BThIzMVUvFi/9oADAMBAAIRAxEAPwDv6IiAIiIAiIgCIiAIiIAiIgCIiAIiIAiIgCIiAIiIAiIgCI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Vpk4Y1C2Wtg0azFG0ENBaG4ycnfbupCjwPrDS0hsNYdcySc3bHQZXMoQ/dZYtl+P6mnVB04GLyR93/z6lRtxyRW3SO57E8jnF07t8kHBIA6/Vee6WLT2x5cSQMMYMuJwM7d99l0+vwIyTkdqOoSzhowGRgMaPT/zCsVDR9P0xuKdWOI93AZcfmTuvHn11R5YLZh2YOXmW+lyJa9/V/he4pnCPBk1azFe1CLwhFgxxH7Tj2LvLHXC6EEHRerMuundLmka+NjQx4ckAiIoiwEREAREQBERAEREAREQBERAEREAREQBERAEREAREQBERAEREAREQBMIiA8wEwF6iA8wEwF6iAIiIAiIgCIiAIiIAiIgCIiAIiIAiIgCIiAIiIAiIgCIiAIiIAiIgCIiAIiIAiIgCIiAIiIAiIgCIiAIiIAiIgCIiAIiIAiIgCIiAIiIAiIgCIiAIiIAiIgCIiAIiIAiIgCIiAIiIAiIgCIiAIiIAiIgCIiAIiIAiIgCIiAIiIAiIgCIiAIiIAiIgCIiAIiIAiIgCIiAIiIAiIgCIiAIiIAiIgCIiAIiIAiIgCIiAIiIAiIgCIiAIiIAiIgCIiAIiIAiIgCIiAIiIAiIgCIiAIiIAiIgCIiAIiIAiIgCIiAIiIAiIgCIiAIiIAiIgCIiAIiIAiIgCIiAIiIAiIgCIiA//9k="
}]

最佳答案

 // create new objects
// as per comment this use Activity context
imageView[jsonLength] = new ImageView(getApplicationContext());

try{

// i<=jsonLength change to i<=jsonLength-1
// Loop through the array elements
for(int i=0;i<=jsonLength;i++)

关于android - Android 中的循环 ImageView,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47386879/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com