title: using volley library in fragments and array adapter
body: <p>Trying to use volley library for the first time. my Adapter seems to be null everytime. logcat says :</p>
  
  <pre><code>04-19 14:23:05.943: E/AndroidRuntime(2695): Caused by: java.lang.NullPointerException
  04-19 14:23:05.943: E/AndroidRuntime(2695):     at com.wordpress.yourhappening.happening.Homepage.onStart(Homepage.java:93)
  </code></pre>
  
  <p>line 93 is <code>list.setAdapter(myadapter);</code></p>
  
  <p>This is my fragment: </p>
  
  <pre><code>public class Homepage extends Fragment{
  
      public Homepage(){}
  
      ListView list;
      private static String url = "http://192.168.1.6/webservice/events.php";
      static final ArrayList&lt;String&gt; TAG_IMG = new ArrayList&lt;String&gt;();
      static final String TAG_SPONSER= "sponser";
      static final ArrayList&lt;String&gt; TAG_TITLE= new ArrayList&lt;String&gt;();
      static final String TAG_LOCATION="event_location";
      static final String TAG_TIME="event_time";
      static final String TAG_ENDTIME="event_endtime";
      static final String TAG_WHOINVITED="event_whoinvited";
      static final ArrayList&lt;String&gt; TAG_MESSAGE=new ArrayList&lt;String&gt;();
      static final String TAG_DRESSCODE="event_dresscode";
      private ImageLoader mImageLoader;
      ViewFlipper flippy;
  
  
      @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container,
              Bundle savedInstanceState) {
  
          View rootView = inflater.inflate(R.layout.homepage, container, false);
  
          return rootView;
      }
      @Override
      public void onStart() {
          super.onStart();
          /////////////Slideshow///////////
  ///////////////////Slider ends\\\\\\\\\\\\\\\\\\\\\
          final BentonAdapter myadapter = new BentonAdapter(getActivity(), url, TAG_TITLE, TAG_MESSAGE, TAG_IMG);
          list.setAdapter(myadapter);
  
          RequestQueue queue = Volley.newRequestQueue(getActivity());
          mImageLoader = new ImageLoader(queue, new ImageLoader.ImageCache() {
              private final LruCache&lt;String, Bitmap&gt; mCache = new LruCache&lt;String, Bitmap&gt;(10);
              public void putBitmap(String url, Bitmap bitmap) {
                  mCache.put(url, bitmap);
              }
              public Bitmap getBitmap(String url) {
                  return mCache.get(url);
              }
          });
          JsonObjectRequest JOR = new JsonObjectRequest(Request.Method.GET, url, null,
                      new Response.Listener&lt;JSONObject&gt;()
                  {
  
                      @Override
                      public void onResponse(JSONObject response) {
  
                          try 
                              {
                              JSONArray posts = (JSONArray) response.getJSONArray("posts");
  
                              for(int i=0; i&lt;posts.length();i++){
  
  
                                  TAG_TITLE.add(posts.getJSONObject(i).getString("title"));
                                  TAG_MESSAGE.add(posts.getJSONObject(i).getString("message"));
                                  TAG_IMG.add(posts.getJSONObject(i).getString("event_img"));
                                  }
                              } 
                          catch (JSONException e) 
                              {
                              }
  
                          myadapter.notifyDataSetChanged();
  
                      }}, new Response.ErrorListener(){
  
                          @Override
                          public void onErrorResponse(VolleyError Error) {
                              Toast.makeText(getActivity(), Error.toString(), Toast.LENGTH_LONG).show();
  
                          }
                      });
          queue.add(JOR);
       // //Attempting Onclick method \\\\
          list=(ListView)getView().findViewById(R.id.list);// has to be before list.setonclick...
  
      });//end of onitemclick
      //startService(new Intent(this, NotificationService.class));
      }//end of onCreate\\\
  }
  </code></pre>
  
  <p>My ArrayAdapter (in a different java file):</p>
  
  <pre><code>public class BentonAdapter extends ArrayAdapter&lt;String&gt;{
      Context context;
      ArrayList&lt;String&gt;mtitle;
      ArrayList&lt;String&gt;mdesc;
      ArrayList&lt;String&gt;mImg;
      String murl ;
  
      private ImageLoader mImageLoader;
  
  
      public BentonAdapter(Context c, String url, ArrayList&lt;String&gt;title, ArrayList&lt;String&gt;desc,
                      ArrayList&lt;String&gt;img) {
          super(c, R.layout.single_line, R.id.title, title);
          this.context = c;
          this.mtitle = title;
          this.mdesc=desc;
          this.mImg=img;
          this.murl = url;
      }
  
      @Override
      public View getView(int position, View convertView, ViewGroup parent) {
          LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
          View row = inflater.inflate(R.layout.single_line, parent, false);
          TextView finaltitle = (TextView)row.findViewById(R.id.title);
          TextView finaldesc = (TextView)row.findViewById(R.id.subTitle_single);
          NetworkImageView ximg = (NetworkImageView)row.findViewById(R.id.event_pic);
          finaltitle.setText(mtitle.get(position));
          finaldesc.setText(mdesc.get(position));
          ximg.setImageUrl(mImg.get(position), mImageLoader);
          return row;
      }
  
  }
  </code></pre>
  
  <p>I am almost certain the issue has to do with the context, but i cant figure it out.</p>