Android: Help with NullPointer
<p>I have this method inside an Activity which implements an ImageLoader class:</p>

<pre><code>public void imageLazy(final ImageView image,Project pro)
    {
         String imageurl = pro.smallImageUrl;
        imageLoadery.displayImage(imageurl, activity,image);
    }
</code></pre>

<p>but everytime I run the Activity, the app crashed. There's a return null pointer on this line</p>

<pre><code>imageLoadery.displayImage(imageurl, activity,image);
</code></pre>

<p>and it refers to the first line on this method on ImageLoader class:</p>

<pre><code>if(((String)photoToLoad.imageView.getTag()).equals(photoToLoad.url)){
                        BitmapDisplayer bd=new BitmapDisplayer(bmp, photoToLoad.imageView);
                        Activity a=(Activity)photoToLoad.imageView.getContext();
                        a.runOnUiThread(bd);
                    }
</code></pre>

<p>All I know, what maybe null ist: <code>tag</code>, <code>url</code>, or <code>image</code>. 
Can anybody help me to solve my problem? Thx</p>

<p><strong>FYI:</strong>
the method above is also applied in my listview adapter below. Maybe this can be a reference to help you guys to solve my case:</p>

<pre><code>public View getView(int position, View convertView, ViewGroup parent) {

        ViewHolder holder = null;

        // Inflate the view
        if (convertView == null) {

            convertView = mInflater.inflate(resource, null);
            holder = new ViewHolder();
            holder.image = (ImageView) convertView.findViewById(R.id.image);
            holder.textTitle = (TextView) convertView
                    .findViewById(R.id.txt_title);
            convertView.setTag(holder);

        } else {
            holder = (ViewHolder) convertView.getTag();
        }

        Project project = items.get(position);

        holder.textTitle.setText(project.project_title);

        String imageurl = project.smallImageUrl;
        holder.image.setTag(imageurl);
        imageLoader.displayImage(imageurl, activity, holder.image);
        return convertView;

    }
</code></pre>

<p><strong>What makes it difficult for me, the method in ListView Adapter apply layout inflater for the Tag, which I barely need on my activity above</strong></p>

<p>I'm open to any kind of solution. Thank you</p>

<p><strong>UPDATED</strong></p>

<p>Stacktrace:</p>

<pre><code>05-16 09:02:00.758: INFO/System.out(441): http://cdn.spendino.de/web/img/projects/home/1263830540.jpg
05-16 09:02:00.769: INFO/System.out(441): spendino.de.Main@43d17ab0
05-16 09:02:00.778: INFO/System.out(441): android.widget.ImageView@43d041f0
05-16 09:02:00.778: INFO/System.out(441): http://cdn.spendino.de/web/img/projects/home/1263997113.jpg
05-16 09:02:00.801: INFO/System.out(441): spendino.de.Main@43d17ab0
05-16 09:02:00.829: INFO/System.out(441): android.widget.ImageView@43d17bd0
05-16 09:02:00.829: INFO/System.out(441): http://cdn.spendino.de/web/img/projects/home/1290615697.jpg
05-16 09:02:00.829: INFO/System.out(441): spendino.de.Main@43d17ab0
05-16 09:02:00.829: INFO/System.out(441): android.widget.ImageView@43d18098
05-16 09:02:01.398: INFO/ActivityManager(33): Displayed activity spendino.de/.Main: 3891 ms (total 3891 ms)
05-16 09:02:01.948: WARN/dalvikvm(441): threadid=15: thread exiting with uncaught exception (group=0x4001b188)
05-16 09:02:01.958: ERROR/AndroidRuntime(441): Uncaught handler: thread Thread-9 exiting due to uncaught exception
05-16 09:02:01.978: ERROR/AndroidRuntime(441): java.lang.NullPointerException
05-16 09:02:01.978: ERROR/AndroidRuntime(441):     at spendino.de.ImageLoaderCache$PhotosLoader.run(ImageLoaderCache.java:244)
</code></pre>
