android - Image receive slow from server json format? -


here receiving picture json in form of json , display picture in listview, problem images receive smoothly slow, mean display 1 pic , after3,4 second display 1 more , simillarly. want picture should display atonce,so sholud do? here code

 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");                             (int =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 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();                 } 

and here custom adapter code

 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()); 

please 1 me should that?

what kind of pictures talking here? huge in size ? try if works

instead of

    picasso.with(context).load(services.getnews_icon()).into(holder.icon); 

try

    picasso.with(context).load(services.getnews_icon()).fit().into(holder.icon); 

Comments

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

android - CoordinatorLayout, FAB and container layout conflict -