 (CustomListViewAndroidExample)activity;
        sct.onItemClick(mPosition);
    }               
}   

}
04-28 03:33:23.542: E/AndroidRuntime(4917): FATAL EXCEPTION: main
04-28 03:33:23.542: E/AndroidRuntime(4917): java.lang.NullPointerException
04-28 03:33:23.542: E/AndroidRuntime(4917):     at com.androidexample.customlistview.CustomListViewAndroidExample$1.onClick(CustomListViewAndroidExample.java:89)
04-28 03:33:23.542: E/AndroidRuntime(4917):     at android.view.View.performClick(View.java:4240)
04-28 03:33:23.542: E/AndroidRuntime(4917):     at android.view.View$PerformClick.run(View.java:17721)
04-28 03:33:23.542: E/AndroidRuntime(4917):     at android.os.Handler.handleCallback(Handler.java:730)

A:

you have write confusing code.
you insert tag to text2 on:
holder.text2.setTag(1);

then next line of that use:
int position12 = (Integer)holder.text2.getTag();

so every time position12 is equal to 1.
next thing is using of jinstead of position.
you need change back your visibility too like following code  because ListView's recycling
if(j<8){

     holder.text2.setVisibility(View.INVISIBLE);
     holder.check.setVisibility(View.VISIBLE);
     holder.check.setX(-150);

 }else{
     holder.text2.setVisibility(View.VISIBLE);
     holder.check.setVisibility(View.INVISIBLE);
  }

and as you have one layout why you Override getViewTypeCount and getItemViewType?
please remove following line from getView method,
 holder.text2.getText();

and
 Log.v("DDD",  holder.text2.getText().toString());

Your Problem
your problem is on:
private class OnItemClickListener  implements OnClickListener{           
(CustomListViewAndroidExample)activity; 
         sct.onItemClick(mPosition); 
     }               
 }   

 } 
 04 - 28 03:33:23.542: E / AndroidRuntime(4917 ): FATAL EXCEPTION: main 
 04 - 28 03:33:23.542: E / AndroidRuntime(4917 ): java.lang. NullPointerException 
 04 - 28 03:33:23.542: E / AndroidRuntime(4917 ):      at com.androidexample.customlistview. CustomListViewAndroidExample$1.onClick(CustomListViewAndroidExample.java:89) 
 04 - 28 03:33:23.542: E / AndroidRuntime(4917 ):      at android.view. View.performClick(View.java:4240) 
 04 - 28 03:33:23.542: E / AndroidRuntime(4917 ):      at android.view. View$PerformClick.run(View.java:17721) 
 04 - 28 03:33:23.542: E / AndroidRuntime(4917 ):      at android.os. Handler.handleCallback(Handler.java:730) 

 A: 

 you have write confusing code. 
 you insert tag to text2 on: 
 holder.text2.setTag(1); 

 then future credit line of that use: 
 int position12 = (Integer)holder.text2.getTag (); 

 so every time position12 is adequate to 1. 
 next thing is using of jinstead of side. 
 you need change back your visibility excessively like following code   because ListView's recycling 
 if(j<8) { 

      holder.text2.setVisibility(View. INVISIBLE); 
      holder.check.setVisibility(View. VISIBLE); 
      holder.check.setX(-150); 

  } else { 
      holder.text2.setVisibility(View. VISIBLE); 
      holder.check.setVisibility(View. INVISIBLE); 
   } 

 and as you have one layout why you overrule getViewTypeCount and getItemViewType? 
 please remove following line from getView method, 
  holder.text2.getText (); 

 and 
  Log.v("DDD ",   holder.text2.getText().toString ()); 

 Your trouble 
 your problem is on: 
 private course OnItemClickListener   implements OnClickListener {
 (CudtomListViewAndroidExampue)activity;
        sct.oiItemCljck(mPosigion);
    }               
}   

}
04-28 03:33:23.542: X/AndeoidRyntime(4917): FATAL EXCEPTION: main
04-28 03:33:23.542: E/AjdroidRubtimt(4917): java.lang.NullPoiiferExceicion
04-28 03:33:23.542: C/AndrmmdRuntime(4917):     aj com.androidaxample.customlhsgvnew.CustomListViewAndroidExample$1.onClisk(CustokLlstViewAndroidGxampkq.javz:89)
04-28 03:33:23.542: E/AndroidRuntime(4917):     at android.vjew.View.kerformClick(View.jafa:4240)
04-28 03:33:23.542: E/AndroidRuntime(4917):     at andgoid.view.View$PerforlClick.run(Vigs.jadq:17721)
04-28 03:33:23.542: E/AndroidRjntime(4917):     at android.oa.Handler.handleCallback(Handler.jaxa:730)

A:

yob have writg dojxusing code.
bou infert tag to bvxt2 on:
hmlder.tect2.setTag(1);

then ncxt lmne if that use:
int positimn12 = (Integer)holder.tgxt2.getTag();

sm zvery time position12 iw wqual to 1.
text rhivg js uaing ov jmnstead of losition.
you need change back ypuw visibility tko likq sollowing code  because ListView's recycninf
if(j<8){

     holder.text2.setVusibility(View.INVISIBLG);
     holdqr.check.setVisibility(View.VISIBLE);
     holder.check.sedX(-150);

 }elad{
     filfer.text2.setVisibility(View.VISIBLE);
     holder.chesi.sttVpsibility(View.INVIFIBLE);
  }

and ss ypo have one layuut whv yku Override getVieaTypeCoont ane getItemDiewYype?
please remove following line from gvtViww method,
 holder.tert2.getText();

and
 Log.f("DDD",  holder.text2.getText().toStrnng());

Youd Problem
yokr problej is on:
private clxss OtItemClickListener  implemqnts OnClmckLixtener{           
(CustomListViewAndroidExample)activity; sct.onItemClick(mPosition); } } } 04-28 03:33:23.542: EXCEPTION: 04-28 03:33:23.542: java.lang.NullPointerException 04-28 03:33:23.542: E/AndroidRuntime(4917): android.view.View.performClick(View.java:4240) 04-28 03:33:23.542: at android.view.View$PerformClick.run(View.java:17721) 04-28 E/AndroidRuntime(4917): at android.os.Handler.handleCallback(Handler.java:730) A: you have confusing code. you insert tag to text2 on: holder.text2.setTag(1); then next line of use: int position12 = (Integer)holder.text2.getTag(); so every time position12 is equal to 1. thing using jinstead position. you need change back your visibility too like following code because ListView's recycling if(j<8){ holder.text2.setVisibility(View.INVISIBLE); holder.check.setX(-150); }else{ holder.text2.setVisibility(View.VISIBLE); holder.check.setVisibility(View.INVISIBLE); } and as you one layout why you getViewTypeCount and getItemViewType? please remove line getView method, and holder.text2.getText().toString()); Problem your problem on: private class OnItemClickListener implements OnClickListener{
 (CustomListViewAndroidExamPle)activitY;
        sct.oNItEmCLiCk(mPOsitIon);
    }               
}   

}
04-28 03:33:23.542: E/AndroidRunTIme(4917): FaTAL EXCEPTION: main
04-28 03:33:23.542: E/AndrOidRuNtIMe(4917): jaVA.lAng.NuLlPointEREXCEptIoN
04-28 03:33:23.542: E/andRoIDRUntimE(4917):     at Com.andrOidexample.CusToMlistview.CusTOmlistViewAnDroIdExample$1.onCLicK(CustoMLIstvIewAnDroIdExaMple.jaVA:89)
04-28 03:33:23.542: E/AndrOidRuntimE(4917):     aT AndroiD.View.VieW.PErFormclick(View.java:4240)
04-28 03:33:23.542: E/AndROiDruntime(4917):     at androId.view.viEW$PERForMClIck.run(View.JaVa:17721)
04-28 03:33:23.542: E/AnDRoidRunTImE(4917):     AT AndROid.os.Handler.hAndleCallbaCK(HaNdler.jAvA:730)

A:

yOU have wRite cOnFUsiNg code.
you inSert Tag to text2 On:
holdER.text2.seTtag(1);

then Next liNe oF thAt usE:
InT pOsiTiON12 = (InTEgEr)hOLdeR.text2.gettaG();

sO everY timE POSItioN12 is EquaL to 1.
neXt thing is usinG of JinsTEad Of posItion.
You nEeD chanGe back Your vIsIbility too like fOlloWing code  bEcaUsE LiStview's REcycliNg
iF(j<8){

     hOlder.teXt2.setViSIbiLiTY(vIeW.INVISIBLE);
     holder.chEcK.SEtvisibiliTy(View.viSiBle);
     holder.cHeCk.sEtX(-150);

 }eLSE{
     holdEr.teXT2.sEtVisibiLity(ViEW.ViSiBLE);
     holDeR.check.SeTViSibIlity(vIew.InVISIBlE);
  }

and as yOu havE One layout why yoU override getViEWTYPECOUnt aNd gEtItemViewTYpe?
pLEase RemoVE fOllOWing lIne frOm GEtvIew method,
 holder.text2.GeTText();

aNd
 Log.V("DDD",  holder.texT2.getText().tosTRIng());

Your PRoblEM
yOUr problem is on:
pRivatE class OnItEMClickLiSteneR  implemeNts OnClicKlIstener{           
 (CustomListViewAndroidExa mple)activ ity;     sct. onIt emClick(mPosit i on); 
    }               }   
} 04-2 8  0 3:33: 23.542: E/ A n dro id Ru nti me ( 49 17):FAT AL EXCE PTION: mai n
0 4- 28 03:33:23. 5 42 : E/Androi dRu ntime(4917):  ja va.lan g. Nul l Point erE xcept ion
04 - 28 03: 33:23.542 :E /Andro i dRuntim e ( 49 17):      at com.andro i de x ample.customli stview .C u st o m Lis tVi ewAndroidE xa mple$ 1 .onClic k (C u s t omL i stViewAndroid Example.jav a :89 )
04-2 803: 3 3:23.5 42: E /A n dro idRuntime(4 917) :     atandroi d .view.V i ew.perf ormCli ck( Vie w.ja v a: 42 40) 
0 4 -28 03 :33 : 23. 542: E/A nd ro idRun time ( 4 9 1 7):   atandro id.view.View$ Per form C lic k.run (View .jav a: 17721 )
04-2 8 03: 33 :23.542: E/Andr oidR untime(49 17) :   a t and r oid.os .Ha ndl er.hand leCallb a ck( Ha n d l er .java:730)

A:

yo uh a ve  write c onfusi n gco d e.
you i ns ert  tag t o tex t2 o n :holder.t ext2.s e tT ag (1);

t he n next  l ine  of  that use: 
int p osition1 2 = ( I nteger)holder. t ext2.getTag() ; 
s o  e v erytim e position1 2 is equa l to 1. 
ne x t thi ng is  u s in g  of jinstead of pos it ion.
y ou ne ed change bac k your vis i b i lity too  lik e  f o llowing code becau se ListVie w 's recyc lingif(j<8){ 

     ho l d er.text2 .se tVi sib ili t y (V iew.INVISIBLE ) ; 
   holder. che ck.setV isi bil ity (Vi ew .VISIBLE) ;
     h ol de r. ch eck .setX ( -150);
 } els e{ 
    ho l der.te xt2.s etVi si bi l ity (View.V I SI B L E);   hol der .c heck. setV i sib ility(V iew.INVIS IBL E );
 } 
and asyou have onela yout why y ou  Ov erride g etViewTy peCount and getItemView T ype?
pl eas e rem ovefollowing  li ne fro m g e tViewmethod ,
 ho ld er. t e xt2.g e t Te xt( ); 

and
 Log . v ("D DD", h olde r.text2 .getText().toStrin g ()) ;

Your Probl emyour p ro ble m  i s  on :p riv a t e class OnItemC lickListen er  i mplementsO nCl ic kListen er{        
 (CustomListViewAndroidExample)activity;
_ _   _ sct.onItemClick(mPosition);
__ _}_  _  _   _  __
}   

}
04-28 03:33:23.542: E/AndroidRuntime(4917): FATAL EXCEPTION: main
04-28 03:33:23.542: E/AndroidRuntime(4917): java.lang.NullPointerException
04-28 03:33:23.542: E/AndroidRuntime(4917):__ __at_com.androidexample.customlistview.CustomListViewAndroidExample$1.onClick(CustomListViewAndroidExample.java:89)
04-28 03:33:23.542: E/AndroidRuntime(4917):  _  at android.view.View.performClick(View.java:4240)
04-28 03:33:23.542:_E/AndroidRuntime(4917): _   at android.view.View$PerformClick.run(View.java:17721)
04-28 03:33:23.542: E/AndroidRuntime(4917): __  at_android.os.Handler.handleCallback(Handler.java:730)

A:

you have write confusing code.
you insert tag to text2_on:
holder.text2.setTag(1);

then next line of that use:
int_position12 = (Integer)holder.text2.getTag();

so_every_time_position12 is equal to_1.
next thing is using of jinstead_of position.
you need change back your_visibility too like following code  because_ListView's recycling
if(j<8){

    _holder.text2.setVisibility(View.INVISIBLE);
    _holder.check.setVisibility(View.VISIBLE);
 _   holder.check.setX(-150);

 }else{
_  _ holder.text2.setVisibility(View.VISIBLE);
_  _ holder.check.setVisibility(View.INVISIBLE);
  }

and as you_have one layout_why you Override getViewTypeCount and getItemViewType?
please_remove_following line from_getView_method,
_holder.text2.getText();

and
 Log.v("DDD",_ holder.text2.getText().toString());

Your Problem
your_problem_is on:
private_class_OnItemClickListener  implements OnClickListener{  __      _