Android ListFragment and lazyloader adapter error
<p>I have a list fragment that gets populated by a custom  adapter (lazy Loading) that should display some text and an image.SO i Built a List fragment and a custom adapter to achieve this.Code below but its throwing the errors shown (Log cat)</p>

<p>ListFragment.java</p>

<pre><code>@Override
 public void onActivityCreated(Bundle savedInstanceState) {
  super.onActivityCreated(savedInstanceState);

   new loadListView().execute();


 }
 protected DashBoardActivity fragmentActivity;    
 public void onAttach (DashBoardActivity activity){
     fragmentActivity = (DashBoardActivity) activity;
 }
 public class loadListView extends AsyncTask&lt;Integer, String, String&gt; {

        @Override
        protected void onPreExecute() {
            super.onPreExecute();
        }

        @Override
        protected String doInBackground(Integer... args) {
              motellist = new ArrayList&lt;HashMap&lt;String, String&gt;&gt;();
              JSONObject json = JSONfunctions.getJSONfromURL(URL);
              try{

                JSONArray  mot = json.getJSONArray("MOTEL");
                    for(int i=0;i&lt;mot.length();i++){                        
                        HashMap&lt;String, String&gt; map = new HashMap&lt;String, String&gt;();        
                        JSONObject e = mot.getJSONObject(i);
                        map.put(KEY_ID, e.getString(KEY_ID));
                        map.put(KEY_NAME, e.getString(KEY_NAME));
                        map.put(KEY_PRICE, e.getString(KEY_PRICE));
                        map.put(KEY_ROOMS, e.getString(KEY_ROOMS));
                        map.put(KEY_REF, e.getString(KEY_REF));
                        map.put(KEY_PHONE, e.getString(KEY_PHONE));
                        map.put(KEY_IMAGE_URL, e.getString(KEY_IMAGE_URL));
                        motellist.add(map);
                    }       
              }catch(JSONException e)      {
                 Log.e("log_tag", "Error kupitisha data "+e.toString());
              }
                return null;
            }   


        @Override
        protected void onPostExecute(String args) {

              //list = getListView();
              adapter=new LazyAdapter (fragmentActivity, motellist);
              list.setAdapter(adapter);
            /**ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt;(getActivity(),
                    android.R.layout.simple_list_item_1, values);
            setListAdapter(adapter);*/

         }
    }
</code></pre>

<p>LazyAdapter.java</p>

<pre><code>private Activity activity;
private ArrayList&lt;HashMap&lt;String, String&gt;&gt; data;
private static LayoutInflater inflater=null;
public ImageLoader imageLoader; 


 public LazyAdapter(Activity a, ArrayList&lt;HashMap&lt;String, String&gt;&gt; d) {
    activity = a;
    data=d;
    inflater = (LayoutInflater)activity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    imageLoader=new ImageLoader(activity);
}


public int getCount() {
    return data.size();
}

public Object getItem(int position) {
    return data.get(position);//nilifix hapa ju am using a custom
}

public long getItemId(int position) {
    return position;
}

public View getView(int position, View convertView, ViewGroup parent) {
    View vi=convertView;
    if(convertView==null)
        vi = inflater.inflate(R.layout.list_row, null);

    TextView NAME = (TextView)vi.findViewById(R.id.name); 
    TextView PRICE = (TextView)vi.findViewById(R.id.board); 
    TextView REF= (TextView)vi.findViewById(R.id.ref); 
    TextView ROOMS = (TextView)vi.findViewById(R.id.units); 
    ImageView thumb_image=(ImageView)vi.findViewById(R.id.list_image); 

    HashMap&lt;String, String&gt; hash = new HashMap&lt;String, String&gt;();
    hash = data.get(position);

    // Setting all values in listview
    NAME.setText(hash.get(ListFragment.KEY_NAME));
    PRICE.setText("PRICE: "+hash.get(ListFragment.KEY_PRICE));
    REF.setText("REF:"+hash.get(ListFragment.KEY_REF));
    ROOMS.setText("ROOMS: "+hash.get(ListFragment.KEY_ROOMS));
    imageLoader.DisplayImage(hash.get(ListFragment.KEY_IMAGE_URL), thumb_image);
    return vi;
}
</code></pre>

<p>LogCat:</p>

<pre><code>0-10 17:42:30.765: E/AndroidRuntime(17557): FATAL EXCEPTION: main
10-10 17:42:30.765: E/AndroidRuntime(17557): java.lang.NullPointerException
10-10 17:42:30.765: E/AndroidRuntime(17557):    at com.symetry.myitprovider.fragment.ListFragment$loadListView.onPostExecute(ListFragment.java:92)
10-10 17:42:30.765: E/AndroidRuntime(17557):    at com.symetry.myitprovider.fragment.ListFragment$loadListView.onPostExecute(ListFragment.java:1)
10-10 17:42:30.765: E/AndroidRuntime(17557):    at android.os.AsyncTask.finish(AsyncTask.java:590)
10-10 17:42:30.765: E/AndroidRuntime(17557):    at android.os.AsyncTask.access$600(AsyncTask.java:149)
10-10 17:42:30.765: E/AndroidRuntime(17557):    at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:603)
10-10 17:42:30.765: E/AndroidRuntime(17557):    at android.os.Handler.dispatchMessage(Handler.java:99)
10-10 17:42:30.765: E/AndroidRuntime(17557):    at android.os.Looper.loop(Looper.java:132)
10-10 17:42:30.765: E/AndroidRuntime(17557):    at android.app.ActivityThread.main(ActivityThread.java:4123)
10-10 17:42:30.765: E/AndroidRuntime(17557):    at java.lang.reflect.Method.invokeNative(Native Method)
10-10 17:42:30.765: E/AndroidRuntime(17557):    at java.lang.reflect.Method.invoke(Method.java:491)
10-10 17:42:30.765: E/AndroidRuntime(17557):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:844)
10-10 17:42:30.765: E/AndroidRuntime(17557):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:602)
10-10 17:42:30.765: E/AndroidRuntime(17557):    at dalvik.system.NativeStart.main(Native Method)
</code></pre>
