ここではjsonの形式でjsonの画像を受信してlistviewにその画像を表示していますが、問題は画像がスムーズに遅く表示され、平均表示1ピクチャと後3,4秒表示がもう1つsimillarly表示されることです。 私は写真がatonceを表示する必要がありますので、私は何をしていますか?ここではいくつかのコードイメージはサーバーjson形式から遅く受信しますか?
protected void onPostExecute(String result){
String s = result.trim();
loadingDialog.dismiss();
JSONObject respObject;
try {
respObject = new JSONObject(s);
String active = respObject.getString("status_message");
if(active.equalsIgnoreCase("success")){
JSONArray array = respObject.getJSONArray("response");
for (int i =0; i<array.length();i++){
JSONObject jsonObject = array.getJSONObject(i);
String icon= jsonObject.getString("image");
String name = jsonObject.getString("title");
String date = jsonObject.getString("date");
id = jsonObject.getString("id");
platformno = jsonObject.getString("platform");
//this is for integer datatype receving
// id = jsonObject.getInt("id");
//platformno = jsonObject.getInt("platform");
listitem.add(new Latest_list(icon,name,date,id,platformno));
}
lv.setAdapter(new Latest_customAdpater(LatestNews.this, listitem));
}else {
Toast.makeText(LatestNews.this, "services received Fail", Toast.LENGTH_LONG).show();
}
} catch (JSONException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
そしてここでは、いずれかが、私はそのために何をすべきか私を助けてください、カスタムアダプタのコードが
holder.icon=(ImageView)convertView.findViewById(R.id.NewsIconID);
holder.name=(TextView) convertView.findViewById(R.id.txt_newsNameID);
holder.date=(TextView) convertView.findViewById(R.id.txt_newsDateID);
holder.id= (TextView) convertView.findViewById(R.id.txt_hiddenID);
holder.platform=(TextView) convertView.findViewById(R.id.txt_hidden2);
convertView.setTag(holder);
} else {
holder = (ViewHolder) convertView.getTag();
}
Latest_list services=newslist.get(position);
Picasso.with(context).load(services.getNews_icon()).into(holder.icon);
Log.d("Url",services.getNews_icon());
holder.name.setText(services.getNews_name());
holder.date.setText(services.getNews_date());
holder.id.setText(services.getNews_id());
holder.platform.setText(services.getNews_platform());
されているのですか?
してみてくださいこれを試して?私に答えてください – mejkan