title: App crashes when endless list view is srcrolled
body: <p>I have a fragment class in which i am loading listview data using asynctask.
  Once the user reaches end of the scroll i need to load the another set of data i am doing this.</p>
  
  <pre><code> listView.setOnScrollListener(new AbsListView.OnScrollListener() {
  
              @Override
              public void onScrollStateChanged(AbsListView view, int scrollState) {
              }
  
              @Override
              public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
  
                  if (userListAdapter == null)
                      return;
  
                  if (userListAdapter.getCount() == 0)
                      return;
  
                  int l = visibleItemCount + firstVisibleItem;
                  if (l &gt;= totalItemCount &amp;&amp; !isLoading) {
                      // It is time to add new data. We call the listener
                      listView.addFooterView(footer);
                      isLoading = true;
                      listener.loadData();
                  }
              }
          });
  </code></pre>
  
  <p>i get callback in loaddata here</p>
  
  <pre><code> @Override
      public void loadData() {
          if (connection != null) {
               connection.getmService().new FetchJsonData().execute(Constants.WEEK_URL1);
          }
  
      }
  </code></pre>
  
  <p><strong>my adapter code.</strong></p>
  
  <pre><code>    public class UserListAdapter extends BaseAdapter {
  
      private LayoutInflater layoutInflater;
      private ArrayList&lt;UserInfoModel&gt; userInfoModelArrayList;
  
      public UserListAdapter(Context context, ArrayList&lt;UserInfoModel&gt; userInfoModelArrayList) {
          this.userInfoModelArrayList = userInfoModelArrayList;
          layoutInflater = LayoutInflater.from(context);
      }
  
      @Override
      public int getCount() {
          return userInfoModelArrayList.size();
      }
  
      @Override
      public Object getItem(int position) {
          return userInfoModelArrayList.get(position);
      }
  
      @Override
      public long getItemId(int position) {
          return position;
      }
  
      @Override
      public View getView(int position, View convertView, ViewGroup parent) {
          ViewHolder viewHolder;
          if (null == convertView) {
              convertView = layoutInflater.inflate(R.layout.list_row, parent,false);
              viewHolder = new ViewHolder();
              viewHolder.imageView = (ImageView) convertView.findViewById(R.id.image_view);
              viewHolder.userName = (TextView) convertView.findViewById(R.id.user_name);
              viewHolder.userID = (TextView) convertView.findViewById(R.id.userID);
              convertView.setTag(viewHolder);
          } else {
              viewHolder = (ViewHolder) convertView.getTag();
          }
          viewHolder.userName.setText(userInfoModelArrayList.get(position).getUserName());
          viewHolder.userID.setText(userInfoModelArrayList.get(position).getUserID());
          return convertView;
      }
  
  
      public void setFilter(ArrayList&lt;UserInfoModel&gt; informationArrayList) {
          userInfoModelArrayList = new ArrayList&lt;&gt;();
          userInfoModelArrayList.addAll(informationArrayList);
          notifyDataSetChanged();
  
      }
  
      public void setData(ArrayList&lt;UserInfoModel&gt; informationArrayList) {
          userInfoModelArrayList.addAll(informationArrayList);
          notifyDataSetChanged();
      }
  
  
      private static class ViewHolder {
          ImageView imageView;
          TextView userName;
          TextView userID;
      }
  }
  </code></pre>
  
  <p>But my app crashes once it reaches first set of data i have added progressbar at the footer of listview.</p>
  
  <p>Error log</p>
  
  <pre><code>02-19 18:45:09.757 3114-3114/example.service.android.santosh.com.androidservice E/AndroidRuntime: FATAL EXCEPTION: main
                                                                                                    Process: example.service.android.santosh.com.androidservice, PID: 3114
                                                                                                    java.lang.NullPointerException: Attempt to invoke virtual method 'int android.view.View.getImportantForAccessibility()' on a null object reference
                                                                                                        at android.widget.AbsListView.obtainView(AbsListView.java:2363)
                                                                                                        at android.widget.ListView.makeAndAddView(ListView.java:1876)
                                                                                                        at android.widget.ListView.fillDown(ListView.java:702)
                                                                                                        at android.widget.ListView.fillGap(ListView.java:666)
                                                                                                        at android.widget.AbsListView.trackMotionScroll(AbsListView.java:5060)
                                                                                                        at android.widget.AbsListView$FlingRunnable.run(AbsListView.java:4608)
                                                                                                        at android.view.Choreographer$CallbackRecord.run(Choreographer.java:858)
                                                                                                        at android.view.Choreographer.doCallbacks(Choreographer.java:670)
                                                                                                        at android.view.Choreographer.doFrame(Choreographer.java:603)
                                                                                                        at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:844)
                                                                                                        at android.os.Handler.handleCallback(Handler.java:746)
                                                                                                        at android.os.Handler.dispatchMessage(Handler.java:95)
                                                                                                        at android.os.Looper.loop(Looper.java:148)
                                                                                                        at android.app.ActivityThread.main(ActivityThread.java:5443)
                                                                                                        at java.lang.reflect.Method.invoke(Native Method)
                                                                                                        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:728)
                                                                                                        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
  </code></pre>
  
  <p>Please help Thanks :)</p>