title: Activity force close when I scroll listview
body: <p>Hi I have a listview with custom adapter ... one image and two text view .... when I scroll upside activity crash ...... listview is attatched with fragment , and fragment is attatched with activity.....</p>
  
  <p>logcat is</p>
  
  <pre><code>    FATAL EXCEPTION: main
  java.lang.NullPointerException
      at com.cuelearn.cuemathteacher.adapters.StudentsEnrollDetailCustomAdapter.getView(StudentsEnrollDetailCustomAdapter.java:64)
      at android.widget.AbsListView.obtainView(AbsListView.java:2255)
      at android.widget.ListView.makeAndAddView(ListView.java:1769)
      at android.widget.ListView.fillUp(ListView.java:706)
      at android.widget.ListView.fillGap(ListView.java:645)
      at android.widget.AbsListView.trackMotionScroll(AbsListView.java:5040)
      at android.widget.AbsListView.scrollIfNeeded(AbsListView.java:3197)
      at android.widget.AbsListView.onTouchEvent(AbsListView.java:3471)
      at android.view.View.dispatchTouchEvent(View.java:7127)
      at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2170)
      at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1905)
      at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2176)
      at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1919)
      at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2176)
      at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1919)
      at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2176)
      at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1919)
      at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2176)
      at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1919)
      at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2176)
      at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1919)
      at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2176)
      at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1919)
      at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1925)
      at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1379)
      at android.app.Activity.dispatchTouchEvent(Activity.java:2396)
      at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1873)
      at android.view.View.dispatchPointerEvent(View.java:7307)
      at android.view.ViewRootImpl.deliverPointerEvent(ViewRootImpl.java:3174)
      at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:3119)
      at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:4155)
      at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:4134)
      at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:4226)
      at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:171)
      at android.view.InputEventReceiver.nativeConsumeBatchedInputEvents(Native Method)
      at android.view.InputEventReceiver.consumeBatchedInputEvents(InputEventReceiver.java:163)
      at android.view.ViewRootImpl.doConsumeBatchedInput(ViewRootImpl.java:4205)
      at android.view.ViewRootImpl$ConsumeBatchedInputRunnable.run(ViewRootImpl.java:4245)
      at android.view.Choreographer$CallbackRecord.run(Choreographer.java:725)
      at android.view.Choreographer.doCallbacks(Choreographer.java:555)
      at android.view.Choreographer.doFrame(Choreographer.java:523)
      at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:711)
      at android.os.Handler.handleCallback(Handler.java:615)
      at android.os.Handler.dispatchMessage(Handler.java:92)
      at android.os.Looper.loop(Looper.java:137)
      at android.app.ActivityThread.main(ActivityThread.java:4745)
      at java.lang.reflect.Method.invokeNative(Native Method)
      at java.lang.reflect.Method.invoke(Method.java:511)
      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
      at dalvik.system.NativeStart.main(Native Method)
  </code></pre>
  
  <p>and this is the custom adapter file </p>
  
  <pre><code>public class StudentsEnrollDetailCustomAdapter  extends ArrayAdapter&lt;StudentInfo&gt; {
  
      Context context;
      StudentInfo[] arr_StudentInfo;
      static class ViewHolder{
  
          TextView tv_student_name,tv_student_class;
          ImageView iv_student_photo;
      }
  
      public StudentsEnrollDetailCustomAdapter(Context context,StudentInfo[] arr_StudentInfo) {
          super(context, R.layout.adapter_students_enroll_detail, arr_StudentInfo);
  
          this.context = context;
          this.arr_StudentInfo = arr_StudentInfo;
  
      }
      @Override
      public View getView(int position, View convertView, ViewGroup parent) {
  
          View rowView = convertView;
          if(rowView == null){
  
              rowView = ((Activity)context).getLayoutInflater().inflate(R.layout.adapter_students_enroll_detail, null);
              ViewHolder viewHolder = new ViewHolder();
  
              viewHolder.tv_student_name = (TextView)rowView.findViewById(R.id.firstLine);
              viewHolder.tv_student_class = (TextView)rowView.findViewById(R.id.secondLine);
              viewHolder.iv_student_photo = (ImageView)rowView.findViewById(R.id.icon);
  
  
              rowView.setTag(viewHolder);
      }
  
  
      ViewHolder holder = (ViewHolder) rowView.getTag();
  
  
  
      StudentInfo s = arr_StudentInfo[position];
  
  
      if(s.getStudentStatus() == 0){
  
  
          holder.tv_student_name.setText(""+s.getStudentName());
          holder.tv_student_class.setText("Class : "+s.getStudentClass());
          if(s.getStudentImage() == null){
              holder.iv_student_photo.setImageResource(R.drawable.ic_contact_picture);
          }else{
              holder.iv_student_photo.setImageBitmap(s.getStudentImage());    
          }
  
          CUtils.setCustomFontNormal(context, holder.tv_student_name, CConstants.FONT_F3);
          CUtils.setCustomFontNormal(context, holder.tv_student_class, CConstants.FONT_F4);
  
  
      }else{
  
          rowView = ((Activity)context).getLayoutInflater().inflate(R.layout.row_null, null);
      }
      return rowView;
      }
  
  
  }
  </code></pre>
  
  <p>error shows in this line of custom adapter but there is no problem ..</p>
  
  <pre><code>holder.tv_student_name.setText(""+s.getStudentName());
  </code></pre>