null pointer exception in eclipse while parsing
<p>i was trying to build a rss feed reader for android and every time i run the application i get the fatal error and nullpointer exception error. please help me solve it.
this is the parsing using the SAX Parser.
im running the avd with andrid 4.0 API 17.</p>

<pre><code>package com.xmlparse;

import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
import android.app.Activity;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.drawable.Drawable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;

public class EfficientAdapter extends BaseAdapter {
private Activity activity;
private ArrayList&lt;Post&gt; data;
private static LayoutInflater inflater = null;
//public ImageLoader imageLoader;
ViewHolder holder;

EfficientAdapter(Activity a, ArrayList&lt;Post&gt; d) {

    activity = a;
    data = d;
    inflater = (LayoutInflater) activity
            .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
//  imageLoader = new ImageLoader(activity.getApplicationContext());

}

@Override
public int getCount() {
    return data.toArray().length;

}

@Override
public Object getItem(int position) {

    return position;
}

@Override
public long getItemId(int position) {

    return position;
}

public static class ViewHolder {
    public TextView label;
    public TextView addr;
    public ImageView image;
}

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

    if (convertView == null) {
        vi = inflater.inflate(R.layout.row, null);
        holder = new ViewHolder();
        holder.label = (TextView) vi.findViewById(R.id.title);
        holder.addr = (TextView) vi.findViewById(R.id.details);
        holder.image = (ImageView) vi.findViewById(R.id.thumb);
        vi.setTag(holder);
    } else
        holder = (ViewHolder) vi.getTag();

    holder.label.setText(data.get(position).getTitle());
    holder.addr.setText(data.get(position).getPubDate());


    URL url = null;
    try {
        url = new URL((data.get(position).getThumbnail()));
    } catch (MalformedURLException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
    InputStream content = null;
    try {
        content = (InputStream)url.getContent();
    } catch (IOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
    Drawable db = Drawable.createFromStream(content , "src"); 
    Bitmap mIcon1 = null;
     try {
         mIcon1 =
                           BitmapFactory.decodeStream(url.openConnection().getInputStream());
    } catch (IOException e) {
        e.printStackTrace();
    }
    holder.image.setImageBitmap(Bitmap.createScaledBitmap(mIcon1, 72, 72,     false));


    return vi;
}

}
</code></pre>

<p>these are the details of the log cat..it shows that the exceptions from the above given
class which is the EficientAdapter.java class.
the  logcat details are...</p>

<pre><code>04-21 21:31:39.888: E/AndroidRuntime(539): FATAL EXCEPTION: main
04-21 21:31:39.888: E/AndroidRuntime(539): java.lang.NullPointerException
04-21 21:31:39.888: E/AndroidRuntime(539):  at        com.xmlparse.EfficientAdapter.getView(EfficientAdapter.java:89)
04-21 21:31:39.888: E/AndroidRuntime(539):  at android.widget.AbsListView.obtainView(AbsListView.java:2033)
04-21 21:31:39.888: E/AndroidRuntime(539):  at  android.widget.ListView.makeAndAddView(ListView.java:1772)
04-21 21:31:39.888: E/AndroidRuntime(539):  at android.widget.ListView.fillDown(ListView.java:672)
04-21 21:31:39.888: E/AndroidRuntime(539):  at android.widget.ListView.fillFromTop(ListView.java:732)
04-21 21:31:39.888: E/AndroidRuntime(539):  at android.widget.ListView.layoutChildren(ListView.java:1625)
04-21 21:31:39.888: E/AndroidRuntime(539):  at android.widget.AbsListView.onLayout(AbsListView.java:1863)
04-21 21:31:39.888: E/AndroidRuntime(539):  at android.view.View.layout(View.java:11180)
04-21 21:31:39.888: E/AndroidRuntime(539):  at android.view.ViewGroup.layout(ViewGroup.java:4203)
04-21 21:31:39.888: E/AndroidRuntime(539):  at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1628)
04-21 21:31:39.888: E/AndroidRuntime(539):  at   android.widget.LinearLayout.layoutVertical(LinearLayout.java:1486)
04-21 21:31:39.888: E/AndroidRuntime(539):  at android.widget.LinearLayout.onLayout(LinearLayout.java:1399)
04-21 21:31:39.888: E/AndroidRuntime(539):  at     android.view.View.layout(View.java:11180)
04-21 21:31:39.888: E/AndroidRuntime(539):  at android.view.ViewGroup.layout(ViewGroup.java:4203)
04-21 21:31:39.888: E/AndroidRuntime(539):  at android.widget.FrameLayout.onLayout(FrameLayout.java:431)
04-21 21:31:39.888: E/AndroidRuntime(539):  at android.view.View.layout(View.java:11180)
04-21 21:31:39.888: E/AndroidRuntime(539):  at android.view.ViewGroup.layout(ViewGroup.java:4203)
04-21 21:31:39.888: E/AndroidRuntime(539):  at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1628)
04-21 21:31:39.888: E/AndroidRuntime(539):  at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1486)
04-21 21:31:39.888: E/AndroidRuntime(539):  at android.widget.LinearLayout.onLayout(LinearLayout.java:1399)
04-21 21:31:39.888: E/AndroidRuntime(539):  at android.view.View.layout(View.java:11180)
04-21 21:31:39.888: E/AndroidRuntime(539):  at android.view.ViewGroup.layout(ViewGroup.java:4203)
04-21 21:31:39.888: E/AndroidRuntime(539):  at android.widget.FrameLayout.onLayout(FrameLayout.java:431)
04-21 21:31:39.888: E/AndroidRuntime(539):  at android.view.View.layout(View.java:11180)
04-21 21:31:39.888: E/AndroidRuntime(539):  at android.view.ViewGroup.layout(ViewGroup.java:4203)
04-21 21:31:39.888: E/AndroidRuntime(539):  at  android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1468)
04-21 21:31:39.888: E/AndroidRuntime(539):  at android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2418)
04-21 21:31:39.888: E/AndroidRuntime(539):  at android.os.Handler.dispatchMessage(Handler.java:99)
04-21 21:31:39.888: E/AndroidRuntime(539):  at android.os.Looper.loop(Looper.java:137)
04-21 21:31:39.888: E/AndroidRuntime(539):  at android.app.ActivityThread.main(ActivityThread.java:4340)
04-21 21:31:39.888: E/AndroidRuntime(539):  at java.lang.reflect.Method.invokeNative(Native Method)
04-21 21:31:39.888: E/AndroidRuntime(539):  at java.lang.reflect.Method.invoke(Method.java:511)
04-21 21:31:39.888: E/AndroidRuntime(539):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
04-21 21:31:39.888: E/AndroidRuntime(539):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
04-21 21:31:39.888: E/AndroidRuntime(539):  at dalvik.system.NativeStart.main(Native Method)
</code></pre>
