你好,我现在没有运气,因为在我把一个网址拉出来后如何处理一个图像因为async只允许一次返回有人有什么建议吗?
/**
* After completing background task Dismiss the progress dialog
* **/
protected void onPostExecute(String json) {
// dismiss the dialog after getting song information
try {
JSONObject jsonObject = new JSONObject(json);
JSONArray jsonArray = jsonObject.getJSONArray("users");
JSONObject arrayElement_0 = jsonArray.getJSONObject(0);
uname = arrayElement_0.getString(TAG_USERNAME);
ptitle = arrayElement_0.getString(TAG_PROFILETITLE);
age = arrayElement_0.getString(TAG_AGE);
gender = arrayElement_0.getString(TAG_GENDER);
status = arrayElement_0.getString(TAG_STATUS);
small = arrayElement_0.getString(TAG_SMALL);
BitmapFactory.decodeStream((InputStream)new URL(small).getContent());
答案 0 :(得分:0)
如果你需要返回多个东西,只需返回一个数组。
答案 1 :(得分:0)
创建一个可以同时包含Bitmap和其他数据的类?虽然将Bitmap保留在一个类中是一个坏主意(它们使用大量内存)。一般来说,最好单独处理位图。
答案 2 :(得分:0)