GithubHelp home page GithubHelp logo

Some image failed to load. about lazylist HOT 4 CLOSED

thest1 avatar thest1 commented on July 25, 2024
Some image failed to load.

from lazylist.

Comments (4)

thest1 avatar thest1 commented on July 25, 2024

No it's not a known issue. I can't answer out of the blue. You should just
debug and figure out what's going on there. If you start my sample
application does it work for you? If it does what's the difference between
sample application and your application?

2012/10/24 Rheza Pahlevi [email protected]

Hi,

i just implement lazylist to my application,but it doesn't work well, some
of the image not loaded to the image view, it will load if i scroll the
listview to the bottom. is there any fix for this ?, or is this known issue
?

thanks


Reply to this email directly or view it on GitHubhttps://github.com//issues/24.

from lazylist.

rheza avatar rheza commented on July 25, 2024

hmm, the example works great. is it possible if it's because the fragment activity ?, other than my adopter, all codes all exactly same with your example.

here is my adapter code,

import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.URL;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;

import com.fedorvlasov.lazylist.*;

import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.PorterDuffXfermode;
import android.graphics.Rect;
import android.graphics.RectF;
import android.graphics.Bitmap.Config;
import android.graphics.PorterDuff.Mode;
import android.os.AsyncTask;
import android.text.format.DateUtils;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.app.Activity;


public class SocialAdaptor extends ArrayAdapter<Social> {

     private ArrayList<Social> social;
     public ImageLoader imageLoader; 
     public SocialAdaptor(Context context,
             int textViewResourceId,
             ArrayList<Social> items) {
        super(context, textViewResourceId, items);
        this.social = items;
        imageLoader=new ImageLoader(context);

     }

     @Override
     public View getView(int position, View convertView, ViewGroup parent) {

             View V = convertView;

             if(V == null) {
                 LayoutInflater vi = (LayoutInflater)getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
                 V = vi.inflate(R.layout.list_item, null);
             }

             Social o = social.get(position);

             TextView posterName = (TextView) V.findViewById(R.id.poster);
             TextView checkinStatusNew = (TextView) V.findViewById(R.id.statustext);
             TextView checkinView = (TextView) V.findViewById(R.id.checkinTime);
             ImageView profilePicView = (ImageView) V.findViewById(R.id.profilePicture);
             TextView commentCountText = (TextView) V.findViewById(R.id.commentCountText);


             commentCountText.setText(o.commentCount);

             posterName.setText(o.employeeName);
             checkinStatusNew.setText(o.activityText);

             imageLoader.DisplayImage(o.employeePicUrl, profilePicView);



             return V;          
     }



 }

Thanks

from lazylist.

thest1 avatar thest1 commented on July 25, 2024

What context do you pass to your Adapter constructor? It should be activity
context not application context.

2012/10/24 Rheza Pahlevi [email protected]

hmm, the example works great. is it possible if it's because the fragment
activity ?, other than my adopter, all codes all exactly same with your
example.

here is my adapter code,

import java.io.InputStream;import java.net.MalformedURLException;import java.net.URL;import java.text.ParseException;import java.text.SimpleDateFormat;import java.util.ArrayList;import java.util.Date;
import com.fedorvlasov.lazylist.*;
import android.content.Context;import android.graphics.Bitmap;import android.graphics.BitmapFactory;import android.graphics.Canvas;import android.graphics.Color;import android.graphics.Paint;import android.graphics.PorterDuffXfermode;import android.graphics.Rect;import android.graphics.RectF;import android.graphics.Bitmap.Config;import android.graphics.PorterDuff.Mode;import android.os.AsyncTask;import android.text.format.DateUtils;import android.util.Log;import android.view.LayoutInflater;import android.view.View;import android.view.ViewGroup;import android.widget.ArrayAdapter;import android.widget.ImageView;import android.widget.RelativeLayout;import android.widget.TextView;import android.app.Activity;

public class SocialAdaptor extends ArrayAdapter {

 private ArrayList<Social> social;
 public ImageLoader imageLoader;
 public SocialAdaptor(Context context,
         int textViewResourceId,
         ArrayList<Social> items) {
    super(context, textViewResourceId, items);
    this.social = items;
    imageLoader=new ImageLoader(context);

 }

 @Override
 public View getView(int position, View convertView, ViewGroup parent) {

         View V = convertView;

         if(V == null) {
             LayoutInflater vi = (LayoutInflater)getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
             V = vi.inflate(R.layout.list_item, null);
         }

         Social o = social.get(position);

         TextView posterName = (TextView) V.findViewById(R.id.poster);
         TextView checkinStatusNew = (TextView) V.findViewById(R.id.statustext);
         TextView checkinView = (TextView) V.findViewById(R.id.checkinTime);
         ImageView profilePicView = (ImageView) V.findViewById(R.id.profilePicture);
         TextView commentCountText = (TextView) V.findViewById(R.id.commentCountText);


         commentCountText.setText(o.commentCount);

         posterName.setText(o.employeeName);
         checkinStatusNew.setText(o.activityText);

         imageLoader.DisplayImage(o.employeePicUrl, profilePicView);



         return V;
 }

}

Thanks


Reply to this email directly or view it on GitHubhttps://github.com//issues/24#issuecomment-9730016.

from lazylist.

rheza avatar rheza commented on July 25, 2024

woa, that fixed the problem. Thank you so much!

from lazylist.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.