title: Problems with scrolling in HorizontalListView(android)
body: <p>I use a <code>HorizontalListView</code> to scroll I use the code below (method setOnItemClickListener)</p>
  
  <pre><code> listview.post(new Runnable() {
                  public void run() {
                      int centerX = listview.getChildAt(position).getLeft();
  
                      listview.scrollTo(centerX);
                  }
              });
  </code></pre>
  
  <p>but there is a problem when position reaches <code>3</code> or more , then I get an error:</p>
  
  <pre><code>12-28 01:33:37.814  20841-20841/com.example.SmsService E/AndroidRuntime﹕ FATAL EXCEPTION: main
  Process: com.example.SmsService, PID: 20841
  java.lang.NullPointerException
          at com.example.SmsService.VideoView$1$1.run(VideoView.java:68)
          at android.os.Handler.handleCallback(Handler.java:733)
          at android.os.Handler.dispatchMessage(Handler.java:95)
          at android.os.Looper.loop(Looper.java:136)
          at android.app.ActivityThread.main(ActivityThread.java:5118)
          at java.lang.reflect.Method.invokeNative(Native Method)
          at java.lang.reflect.Method.invoke(Method.java:515)
          at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:790)
          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:606)
          at dalvik.system.NativeStart.main(Native Method)
  </code></pre>
  
  <p>I think that probably because I use <strong>looped listView</strong>:</p>
  
  <pre><code>  @Override
      public int getCount() {
          return Integer.MAX_VALUE;//
      }
  </code></pre>
  
  <p><strong>how I could fix this problem?</strong> And maybe there are other ways scroll listView? (Scrolling Smooth does not work ) <a href="https://gist.github.com/diha-o/c004352966f07bd02614" rel="nofollow">My Class.</a> And .xml file:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
            android:orientation="vertical"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"&gt;
  &lt;RelativeLayout
          android:layout_width="fill_parent"
          android:layout_height="fill_parent" android:layout_weight="1" android:id="@+id/ll"&gt;
      &lt;VideoView android:layout_width="match_parent" android:layout_height="match_parent" android:id="@+id/videoView"
                 android:layout_gravity="center_horizontal"
                 android:layout_alignParentTop="true"
                 android:layout_alignParentRight="true"
                 android:layout_alignParentBottom="true"
              /&gt;
      &lt;RelativeLayout
              android:layout_width="fill_parent"
              android:layout_height="150dp" android:layout_alignParentBottom="true"
              android:layout_alignParentLeft="true" android:layout_marginBottom="20dp"&gt;
          &lt;LinearLayout
                  android:orientation="horizontal"
                  android:layout_width="fill_parent"
                  android:layout_height="fill_parent"&gt;
              &lt;com.devsmart.android.ui.HorizontalListView
                      android:id="@+id/listview2"
                      android:layout_width="match_parent"
                      android:layout_height="wrap_content"
                      android:clickable="true" android:layout_weight="1"/&gt;
              &lt;com.devsmart.android.ui.HorizontalListView
                      android:id="@+id/listview"
                      android:layout_width="match_parent"
                      android:layout_height="wrap_content"
                      android:smoothScrollbar="true"
                      android:clickable="true" android:layout_alignParentRight="true"            android:layout_weight="1"/&gt;
          &lt;/LinearLayout&gt;
      &lt;/RelativeLayout&gt;
  &lt;/RelativeLayout&gt;
  &lt;/LinearLayout&gt;
  </code></pre>