title: Getting NullPointerException When Setting Listview FirstVisiblePosition
body: <p>When Listview reached the end position(onscroll) i will  get data from database and i need to set position for listview when doing this am Getting NullPointerException </p>
  
  <p>please see the logcat report</p>
  
  <pre><code>Listview TagslistView = (ListView) findViewById(R.id.listView1);
  int index = TagslistView.getFirstVisiblePosition(); 
  TagslistView.setSelectionFromTop(index+1,0);
  </code></pre>
  
  <p>Logcat </p>
  
  <pre><code>a05-15 14:32:55.125: E/AndroidRuntime(22112): FATAL EXCEPTION: main
  05-15 14:32:55.125: E/AndroidRuntime(22112): Process: com.example.co, PID: 22112
  05-15 14:32:55.125: E/AndroidRuntime(22112): java.lang.NullPointerException
  05-15 14:32:55.125: E/AndroidRuntime(22112):    at com.example.co.CustomList.getView(CustomList.java:58)
  05-15 14:32:55.125: E/AndroidRuntime(22112):    at android.widget.AbsListView.obtainView(AbsListView.java:2263)
  05-15 14:32:55.125: E/AndroidRuntime(22112):    at android.widget.ListView.makeAndAddView(ListView.java:1790)
  05-15 14:32:55.125: E/AndroidRuntime(22112):    at android.widget.ListView.fillSpecific(ListView.java:1337)
  05-15 14:32:55.125: E/AndroidRuntime(22112):    at android.widget.ListView.layoutChildren(ListView.java:1620)
  05-15 14:32:55.125: E/AndroidRuntime(22112):    at android.widget.AbsListView.onLayout(AbsListView.java:2091)
  05-15 14:32:55.125: E/AndroidRuntime(22112):    at android.view.View.layout(View.java:14857)
  05-15 14:32:55.125: E/AndroidRuntime(22112):    at android.view.ViewGroup.layout(ViewGroup.java:4641)
  05-15 14:32:55.125: E/AndroidRuntime(22112):    at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1055)
  05-15 14:32:55.125: E/AndroidRuntime(22112):    at android.view.View.layout(View.java:14857)
  05-15 14:32:55.125: E/AndroidRuntime(22112):    at android.view.ViewGroup.layout(ViewGroup.java:4641)
  05-15 14:32:55.125: E/AndroidRuntime(22112):    at android.widget.FrameLayout.layoutChildren(FrameLayout.java:453)
  05-15 14:32:55.125: E/AndroidRuntime(22112):    at android.widget.FrameLayout.onLayout(FrameLayout.java:388)
  05-15 14:32:55.125: E/AndroidRuntime(22112):    at android.view.View.layout(View.java:14857)
  05-15 14:32:55.125: E/AndroidRuntime(22112):    at android.view.ViewGroup.layout(ViewGroup.java:4641)
  05-15 14:32:55.125: E/AndroidRuntime(22112):    at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1671)
  05-15 14:32:55.125: E/AndroidRuntime(22112):    at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1525)
  05-15 14:32:55.125: E/AndroidRuntime(22112):    at android.widget.LinearLayout.onLayout(LinearLayout.java:1434)
  05-15 14:32:55.125: E/AndroidRuntime(22112):    at android.view.View.layout(View.java:14857)
  05-15 14:32:55.125: E/AndroidRuntime(22112):    at android.view.ViewGroup.layout(ViewGroup.java:4641)
  05-15 14:32:55.125: E/AndroidRuntime(22112):    at android.widget.FrameLayout.layoutChildren(FrameLayout.java:453)
  05-15 14:32:55.125: E/AndroidRuntime(22112):    at android.widget.FrameLayout.onLayout(FrameLayout.java:388)
  05-15 14:32:55.125: E/AndroidRuntime(22112):    at android.view.View.layout(View.java:14857)
  05-15 14:32:55.125: E/AndroidRuntime(22112):    at android.view.ViewGroup.layout(ViewGroup.java:4641)
  05-15 14:32:55.125: E/AndroidRuntime(22112):    at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2018)
  05-15 14:32:55.125: E/AndroidRuntime(22112):    at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1775)
  05-15 14:32:55.125: E/AndroidRuntime(22112):    at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1024)
  05-15 14:32:55.125: E/AndroidRuntime(22112):    at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5796)
  05-15 14:32:55.125: E/AndroidRuntime(22112):    at android.view.Choreographer$CallbackRecord.run(Choreographer.java:761)
  05-15 14:32:55.125: E/AndroidRuntime(22112):    at android.view.Choreographer.doCallbacks(Choreographer.java:574)
  05-15 14:32:55.125: E/AndroidRuntime(22112):    at android.view.Choreographer.doFrame(Choreographer.java:544)
  05-15 14:32:55.125: E/AndroidRuntime(22112):    at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:747)
  05-15 14:32:55.125: E/AndroidRuntime(22112):    at android.os.Handler.handleCallback(Handler.java:733)
  05-15 14:32:55.125: E/AndroidRuntime(22112):    at android.os.Handler.dispatchMessage(Handler.java:95)
  05-15 14:32:55.125: E/AndroidRuntime(22112):    at android.os.Looper.loop(Looper.java:136)
  05-15 14:32:55.125: E/AndroidRuntime(22112):    at android.app.ActivityThread.main(ActivityThread.java:5102)
  05-15 14:32:55.125: E/AndroidRuntime(22112):    at java.lang.reflect.Method.invokeNative(Native Method)
  05-15 14:32:55.125: E/AndroidRuntime(22112):    at java.lang.reflect.Method.invoke(Method.java:515)
  05-15 14:32:55.125: E/AndroidRuntime(22112):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
  05-15 14:32:55.125: E/AndroidRuntime(22112):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
  05-15 14:32:55.125: E/AndroidRuntime(22112):    at dalvik.system.NativeStart.main(Native Method)
  </code></pre>