2016-06-29 5 views
0

ここでは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()); 

されているのですか?

+0

してみてくださいこれを試して?私に答えてください – mejkan

答えて

0

ここではどんな種類の写真について話していますか?彼らはサイズが巨大ですか?それは

代わりの

Picasso.with(context).load(services.getNews_icon()).into(holder.icon); 

を動作するかどうかもすべてのAndroid開発者を失った

Picasso.with(context).load(services.getNews_icon()).fit().into(holder.icon); 
+0

固定エラー@siddhesh dighe http://chat.stackoverflow.com/rooms/115894/android-progress-barの詳細については、チャットに来てください – mejkan

関連する問題