private void SearchDublicate(ICursor cur, Options options) { var contact = new Contact (cur); DisplayInfo (cur, contact); if ((options.ByName) & (options.ByPhone)) { CheckByNameAndPhone (contact, cur); return; } if (options.ByName) { CheckByName (contact, cur); return; } if (options.ByPhone) { CheckByPhone (contact, cur); } }
protected override void Run() { Looper.Prepare(); var options = new Options (); var loader = new CursorLoader (Application.Context, ContactsContract.Contacts.ContentUri, null, null, null, null); ICursor cur; cur = (ICursor)loader.LoadInBackground (); cur.MoveToFirst (); while (cur.MoveToNext () && !_mFinished) { SearchDublicate (cur, options); base.Run (); } Message.Obtain(_mhandler,(int)MessageType.Finally).SendToTarget(); }