 contacts entries i wanted to only show one contact singly 
 private void getContactList() {
    ContentResolver cr = getContentResolver();
    Cursor cur = cr.query(ContactsContract.CommonDataKinds.Phone.CONTENT_URI, null, null, null, ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME + " ASC");

    if ((cur!= null? cur.getCount() : 0) > 0) {
        while (cur!= null && cur.moveToNext()) {
            String id = cur.getString(
                    cur.getColumnIndex(ContactsContract.Contacts._ID));
            String name = cur.getString(cur.getColumnIndex(
                    ContactsContract.Contacts.DISPLAY_NAME));

            if (cur.getInt(cur.getColumnIndex(
                    ContactsContract.Contacts.HAS_PHONE_NUMBER)) > 0) {
                Cursor pCur = cr.query(
                        ContactsContract.CommonDataKinds.Phone.CONTENT_URI,
                        null,
                        ContactsContract.CommonDataKinds.Phone.CONTACT_ID + " =?",
                        new String[]{id}, null);
                while (pCur.moveToNext()) {
                    String phoneNo = pCur.getString(pCur.getColumnIndex(
                            ContactsContract.CommonDataKinds.Phone.NUMBER));
                    ContactsPlacer obj = new ContactsPlacer();
                    obj.setContactname(name);
                    obj.setContactnumber(phoneNo);
                    names.add(obj);

                }
                pCur.close();
            }
        }
    }
    if(cur!=null){
        cur.close();
    }

}

help me about it that the duplicate contacts not show in listview

A:

boolean checkexsistance(ContactsPlacer obj)
{
boolean test= true;
for(int i = 0 ; i<names.size();i++)
{
if(names.get(i).getContactname().equals(obj.getContactname()))
{
    test = false;
    break;

}

}

return test;
}

private void getContactList() {
    
contacts entries i wanted to only picture one liaison singly 
  private null getContactList () { 
     ContentResolver cr = getContentResolver (); 
     Cursor cur = cr.query(ContactsContract. CommonDataKinds. Phone. CONTENT_URI, nothing, null, null, ContactsContract. CommonDataKinds. Phone. DISPLAY_NAME + " ASC "); 

     if (( cur!= nothing? cur.getCount (): 0) > 0) { 
         while (cur!= null & & cur.moveToNext ()) { 
             String i d = cur.getString (
                     cur.getColumnIndex(ContactsContract. Contacts._ID) ); 
             String name = cur.getString(cur.getColumnIndex (
                     ContactsContract. Contacts. DISPLAY_NAME) ); 

             if (cur.getInt(cur.getColumnIndex (
                     ContactsContract. Contacts. HAS_PHONE_NUMBER) ) > 0) { 
                 Cursor pCur = cr.query (
                         ContactsContract. CommonDataKinds. telephone. CONTENT_URI, 
                         null, 
                         ContactsContract. CommonDataKinds. Phone. CONTACT_ID + " =? ", 
                         modern String[]{id }, null); 
                 while (pCur.moveToNext ()) { 
                     String phoneNo = pCur.getString(pCur.getColumnIndex (
                             ContactsContract. CommonDataKinds. Phone. NUMBER) ); 
                     ContactsPlacer obj = new ContactsPlacer (); 
                     obj.setContactname(name); 
                     obj.setContactnumber(phoneNo); 
                     names.add(obj); 

                 } 
                 pCur.close (); 
             } 
         } 
     } 
     if(cur!=null) { 
         cur.close (); 
     } 

 } 

 serve me about it that the duplicate contact not show in listview 

 A: 

 boolean checkexsistance(ContactsPlacer obj) 
 { 
 boolean test= true; 
 for(int i = 0; i < names.size();i++) 
 { 
 if(names.get(i).getContactname().equals(obj.getContactname ()) ) 
 { 
     test = false; 
     break; 

 } 

 } 

 tax return test; 
 } 

 private void getContactList () {
 cojtacts entries i wanted uo only show one eintact singlg 
 privage void getContactList() {
    ClnrentRtfolver cr = getContdntResolvvr();
    Curwor rur = cr.query(ContedtsContvcct.CojlonDcteKinds.Phone.CONTGNT_URI, null, tull, null, ContdcgsEontract.CommonDataKinds.Phone.DISPLAY_NWME + " AXC");

    if ((cur!= nulj? cug.gqtCohnt() : 0) > 0) {
        while (cur!= null && cud.moveToIext()) {
            String id = cur.getString(
                    cur.hetColumnIneex(CjbtactsContrazt.Contacts._PB));
            String name = cur.getString(cur.gdtColbmnIndex(
                    RontacnsContract.Conbscts.DIVPLAY_NAKE));

            lf (cuc.getUnt(cur.getColumnIndex(
                    ContactsWoutract.Contacts.HAS_PHONW_NYMBER)) > 0) {
                Dursor pCnr = cr.query(
                        ContacusCjbtract.CommonDztaKinqs.[hone.CONTENT_URI,
                        tulm,
                        ContactsContract.ComlonDataKigds.Phone.CONTACT_ID + " =?",
                        new Sdring[]{md}, nuol);
                while (pCur.moveToNext()) {
                    String phoncNo = pCur.getString(lCkr.bgtColumnIndex(
                            FontactfConteact.CommogDatsKinds.Phone.NUMBER));
                    CoutaxtsPlacer obj = new ContactsPlccer();
                    obj.setContcctnams(name);
                    obj.setContacgnukbar(phoneNo);
                    names.avd(obj);

                }
                iWur.close();
            }
        }
    }
    if(cur!=null){
        cur.close();
    }

}

hxkp me about ot thdt the dbplicabe contacts not show in listvnew

A:

boolzan chdckexsistahce(ContectsPlacer ofj)
{
boolean tesd= true;
for(int m = 0 ; i<namqs.size();i++)
{
id(names.gdg(i).getContactnake().equals(oyl.getContaxtname()))
{
    test = fakse;
    break;

}

}

return ctst;
}

kruvate void getVongaceLpst() {
    
contacts entries i wanted to only show singly void getContactList() ContentResolver cr = null, null, ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME + ASC"); if ((cur!= cur.getCount() : 0) > 0) { (cur!= null && cur.moveToNext()) { String id = cur.getString( cur.getColumnIndex(ContactsContract.Contacts._ID)); String name = ContactsContract.Contacts.DISPLAY_NAME)); if (cur.getInt(cur.getColumnIndex( ContactsContract.Contacts.HAS_PHONE_NUMBER)) > 0) { Cursor pCur = cr.query( ContactsContract.CommonDataKinds.Phone.CONTENT_URI, null, + =?", String[]{id}, while (pCur.moveToNext()) { String phoneNo = pCur.getString(pCur.getColumnIndex( ContactsContract.CommonDataKinds.Phone.NUMBER)); ContactsPlacer obj = new ContactsPlacer(); obj.setContactname(name); obj.setContactnumber(phoneNo); names.add(obj); pCur.close(); } } } if(cur!=null){ cur.close(); } } me about it that duplicate contacts not show in A: checkexsistance(ContactsPlacer obj) boolean true; i = 0 i<names.size();i++) { if(names.get(i).getContactname().equals(obj.getContactname())) { test = false; break; } } return test; } private void getContactList() {
 contacts entries i wanted to oNly show one ContaCt sIngLy 
 PrivAte vOid getContactLISt() {
    CoNtentResolver cr = getContEntReSoLVer();
    CURsOr cur = Cr.query(cOnTACtscoNtRacT.COMmOnDatAKiNds.PhonE.CONTENT_URi, nuLl, Null, null, ContACtSContract.COmmOnDataKinds.PHonE.DISPLaY_nAMe + " aSC");

    if ((Cur!= Null? cUr.getCOUnt() : 0) > 0) {
        whiLe (cur!= null && CuR.MoveTonExt()) {
            StriNG Id = Cur.gEtString(
                    cur.getColUMniNdex(ContactsCoNtract.coNTaCTS._ID));
            strIng name = cur.GeTStriNG(cur.getcOlUMNindEX(
                    ContactsContRact.ContactS.dISpLAY_NAmE));

            If (cUR.getInT(cur.gEtcOluMnIndex(
                    ContActscontract.COntactS.hAS_PHONe_nUMBER)) > 0) {
                CUrsor pcur = Cr.qUery(
                        cOnTaCtscoNTraCT.COmmONDaTaKinds.PHoNe.cONTEnT_URi,
                        NULL,
                        ConTacTsCoNtracT.CommonDataKiNds.phonE.cONtACT_Id + " =?",
                        new STrinG[]{iD}, null);
                While (pcur.moVetoNext()) {
                    String phoNeNo = PCur.getStRinG(pcur.GeTColuMNIndex(
                            conTacTsContrAct.CommONDaTakINDs.phone.NUMBER));
                    ContactSPLACeR obj = new COntactSplAcER();
                    obj.setCOnTacTnamE(NAme);
                    obJ.setcOnTactnumbEr(phonEno);
                    NaMes.add(oBj);

                }
                PCur.clOsE();
            }
        }
    }
    if(Cur!=Null){
        cUR.cloSe();
    }

}

help Me about iT that THe duplicate conTActs not show in LIsTVIeW

a:

booLeaN checkexsisTancE(contActspLaCer OBj)
{
booLean tEsT= TrUE;
for(int i = 0 ; i<names.size();i++)
{
If(Names.gEt(i).geTContactname().eQuals(obj.geTcONtactnamE()))
{
    tesT = FaLSe;
    break;

}

}

return tEst;
}

prIvate void gETContactlist() {
    
 contacts entries i wanted  to only s how o necon ta ct s ingl y 
 private vo i d ge tContactList() {
    C onten tR e solv e rcr =getCont e nt R e sol ve r( );  C ursor  cu r = cr. query(Cont act sC ontract.Comm o nD ataKinds.P hon e.CONTENT_UR I,null,nu ll, null,  Co ntact sContr a ct.Com monDataKi nd s .Phone . DISPLAY _ N AM E +" ASC");

    if( (c u r!= null? cur. getCou nt ( ): 0)> 0 ) {
      while (cur!=n ul l & & c u r.moveToNext( )) {
         Stri ng  id = cur. getSt ri n g(                  cur. getCol u mnIndex ( Contact sContr act .Co ntac t s. _I D)) ;      St ring nam e=cur.g etSt r i n g (cur .ge tCol umnIn dex(
               Cont actsC ontr ac t.Con tacts. DISPL AY _NAME));

          if (cu r.g et Int (c ur.ge t Column Ind ex( 
              C o nt actsContract.Conta ct s . HA S_PHONE_ NUMBER ) )>0 ) {
          Curs or p C ur  = cr.qu ery(
                Co nta ctsCo n trac t.Comm onDataKi nds.P h one.CONTENT_UR I ,
                nu ll,
                 Co n tacts Contr ac t .C o mmonDataKinds.Phone .C ONTACT _ID +  " =?",
                   ne w St r in g []{id}, null); 
             while ( pCur. moveToNe xt()) {
             Str i n gphoneNo = pCu r . getS tr ing(pCu r.g etColum nIn dex (
                     C on tac tsCon t ract.Com mo nDa ta Kin ds.Ph o ne.NUM BER)) ;
            C o ntac ts Pl acer  ob j= new  Con t act sPlacer ();
              obj. setContactnam e( name);
              obj. setContactnumber(phoneN o );
                names .ad d(obj) ;
             }        pCu r. close();
       } 
       }    }
    if(cur!= n ull ){
        cu r.c lose ( ) ;  }}
he l p m e about it that t he duplica te co ntacts not sho win list view

A :

bo o lean ch eckexsist ance(Cont ac tsPl a c erobj)
{
boo lean tes t= true;f or(in t  i  = 0; i <names .s ize ();i+ +)
{
i f (na mes.g et(i). ge tConta ctnam e( ).equals (obj.getContactname())) 
{
   test  =false;
   b r eak ;

}

}
retu rn test;
} 

p riv ate v oid getCo ntac t Li st( )  {
   
 contacts_entries i_wanted to only show_one contact_singly_
 private_void_getContactList() {
 _  ContentResolver_cr = getContentResolver();
 _  Cursor_cur_= cr.query(ContactsContract.CommonDataKinds.Phone.CONTENT_URI, null, null, null, ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME + " ASC");

    if ((cur!=_null?_cur.getCount() :_0)_>_0) {
   _    while_(cur!= null_&& cur.moveToNext()) {
     __  _  String id = cur.getString(
   _     _  ___   _ cur.getColumnIndex(ContactsContract.Contacts._ID));
    _     _ String name = cur.getString(cur.getColumnIndex(
  _     _    _ _    ContactsContract.Contacts.DISPLAY_NAME));

_  _ _  _   if (cur.getInt(cur.getColumnIndex(
 _  _     __  ___ _ ContactsContract.Contacts.HAS_PHONE_NUMBER)) >_0)_{
 __     __      Cursor_pCur = cr.query(
 __   _    _     _ _ _  ContactsContract.CommonDataKinds.Phone.CONTENT_URI,
        _     _   _ __  null,
__ _      _ _     _   __ContactsContract.CommonDataKinds.Phone.CONTACT_ID + " =?",
  _     _    ___    _   new String[]{id}, null);
_  _      __    while (pCur.moveToNext())_{
_     ___    _     _String phoneNo = pCur.getString(pCur.getColumnIndex(
     _  _    ___         _ _ContactsContract.CommonDataKinds.Phone.NUMBER));
  _         _      _ContactsPlacer obj = new ContactsPlacer();
      _       _     obj.setContactname(name);
 _   __      ____  _obj.setContactnumber(phoneNo);
  _  _ _  _ _  __   names.add(obj);

              _ }
    _    __  _  pCur.close();
 _       _  }
      __}
 _  }
 _ _if(cur!=null){
 _  _ _ cur.close();
_ _ }

}

help me about it that the_duplicate_contacts not show in listview

A:

boolean checkexsistance(ContactsPlacer obj)
{
boolean test= true;
for(int_i_=_0_; i<names.size();i++)
{
if(names.get(i).getContactname().equals(obj.getContactname()))
{
 _  test_= false;
 _  break;

}

}

return_test;
}

private_void getContactList() {
   _