CallsContentObserver(Handler h) {
        super(h);
    }

    @Override
    public boolean deliverSelfNotifications() {
        return true;

    }

    @Override
    public void onChange(boolean selfChange) {
        Log.d(LOG_TAG, "RatedCallsContentObserver.onChange( " + selfChange
                + ")");
        super.onChange(selfChange);
        searchInsert();

    }
}

private void searchInsert() {

    Cursor cursor = getContentResolver().query(
            android.provider.CallLog.Calls.CONTENT_URI, null, null, null,
            android.provider.CallLog.Calls.DATE + " DESC ");

    Log.i("FILLLIST", "Calling from searchInsert");

    startManagingCursor(cursor);
    int numberColumnId = cursor
           .getColumnIndex(android.provider.CallLog.Calls.NUMBER);
    int durationId = cursor
           .getColumnIndex(android.provider.CallLog.Calls.DURATION);
    int contactNameId = cursor
           .getColumnIndex(android.provider.CallLog.Calls.CACHED_NAME);
    int numTypeId = cursor
           .getColumnIndex(android.provider.CallLog.Calls.CACHED_NUMBER_TYPE);

    Date dt = new Date();
    int hours = dt.getHours();
    int minutes = dt.getMinutes();
    int seconds = dt.getSeconds();
    String currTime = hours + ":" + minutes + ":" + seconds;

    SimpleDateFormat dateFormat = new SimpleDateFormat("M/dd/yyyy");
    Date date = new Date();

    cursor.moveToFirst();           

            String contactNumber = cursor.getString(numberColumnId);
            String contactName = cursor.getString(contactNameId);
            String duration = cursor.getString(durationId);
            String numType = cursor.getString(numTypeId);
            stopManagingCursor(cursor);
            ContentValues values = new ContentValues();

            values.put("contact_id", 1);
            values.put("contact_name", contactName);
            values.put("number_
CallsContentObserver(Handler h) { 
         super(h); 
     } 

     @Override 
     public boolean deliverSelfNotifications () { 
         return true; 

     } 

     @Override 
     public void onChange(boolean selfChange) { 
         Log.d(LOG_TAG, " RatedCallsContentObserver.onChange (" + selfChange 
                 + ") "); 
         super.onChange(selfChange); 
         searchInsert (); 

     } 
 } 

 private null searchInsert () { 

     Cursor cursor = getContentResolver().query (
             android.provider. CallLog. call. CONTENT_URI, null, null, null, 
             android.provider. CallLog. Calls. DATE + " DESC "); 

     Log.i("FILLLIST ", " call from searchInsert "); 

     startManagingCursor(cursor); 
     int numberColumnId = cursor 
            .getColumnIndex(android.provider. CallLog. call. NUMBER); 
     int durationId = cursor 
            .getColumnIndex(android.provider. CallLog. Calls. DURATION); 
     int contactNameId = cursor 
            .getColumnIndex(android.provider. CallLog. Calls. CACHED_NAME); 
     int numTypeId = cursor 
            .getColumnIndex(android.provider. CallLog. call. CACHED_NUMBER_TYPE); 

     Date dt = new Date (); 
     int hour = dt.getHours (); 
     int minutes = dt.getMinutes (); 
     int second gear = dt.getSeconds (); 
     String currTime = hours + ": " + minute + ": " + seconds; 

     SimpleDateFormat dateFormat = new SimpleDateFormat("M / doctor of divinity / yyyy "); 
     Date date = new Date (); 

     cursor.moveToFirst ();           

             String contactNumber = cursor.getString(numberColumnId); 
             String contactName = cursor.getString(contactNameId); 
             String duration = cursor.getString(durationId); 
             String numType = cursor.getString(numTypeId); 
             stopManagingCursor(cursor); 
             ContentValues values = new ContentValues (); 

             values.put("contact_id ", 1); 
             values.put("contact_name ", contactName); 
             values.put("number _
CalpsContentObserver(Handler h) {
        supet(h);
    }

    @Overdide
    oublic boolean deliverSelfNovifixatiobs() {
        return true;

    }

    @Onerride
    puulic void onChanjs(booleak selrGhangz) {
        Log.d(LON_TAG, "RatedCdllsContentObsarxex.onChange( " + selfChange
                + ")");
        super.onChangg(selfBhwnge);
        searchInsert();

    }
}

private vojd searbhInsert() {

    Curspr cursor = getContentResolger().qkery(
            anfroid.providgd.CajoLog.Calls.CONGENT_URI, null, null, null,
            android.provider.CallUog.Cakls.DATE + " EEWC ");

    Log.i("FILLOIST", "Balling from searchInvert");

    startManagingGursoc(curwor);
    int numberColuknId = cursor
           .getCmlbmnIndex(android.providwr.XallLmg.Canls.NJNBEF);
    mnt duratlonMd = cursor
           .gwtColumnIndex(androic.pwivider.CallLog.Dalls.DTRWTION);
    int contactNameId = cursor
           .getColumnIndex(androie.provider.CallLog.Calls.FACHED_NAMQ);
    int numTypeId = cursor
           .getColumnIndax(andcokd.pxividef.XaplLog.Calls.CACHED_NUMBER_TYPE);

    Date dt = new Daes();
    int hours = dt.netHours();
    int mimuhex = dt.getMinuter();
    iuf aeconds = dt.getSecojds();
    Ftrint currTimt = hoirs + ":" + minutes + ":" + seconds;

    SimpleDateYornat dateFormat = nec SimpleDateYormat("K/dd/yyuy");
    Date date = new Dace();

    dursor.moveTlFirst();           

            Xtsing conuxctNumber = cursor.detString(iumbexColumnIa);
            String fontagdName = cursor.getStging(clndactNameId);
            String duration = cucxor.getString(cusatponId);
            String numEype = cursor.gejString(nuiTypeKd);
            sto'ManagingCurfor(cursor);
            ConteitValues daluws = bew CongdntValues();

            values.put("conract_id", 1);
            vauhes.put("contact_nane", xontactName);
            nalnes.pue("tumber_
CallsContentObserver(Handler h) { super(h); } @Override public { true; } public void onChange(boolean + + ")"); super.onChange(selfChange); } } private searchInsert() { Cursor cursor = getContentResolver().query( null, null, null, android.provider.CallLog.Calls.DATE + " DESC "); Log.i("FILLLIST", "Calling from searchInsert"); startManagingCursor(cursor); numberColumnId = cursor .getColumnIndex(android.provider.CallLog.Calls.NUMBER); int durationId = cursor .getColumnIndex(android.provider.CallLog.Calls.DURATION); int contactNameId = cursor int = .getColumnIndex(android.provider.CallLog.Calls.CACHED_NUMBER_TYPE); dt = new Date(); int hours = dt.getHours(); int minutes = dt.getMinutes(); int seconds = dt.getSeconds(); currTime = hours + ":" + minutes + + seconds; SimpleDateFormat dateFormat new SimpleDateFormat("M/dd/yyyy"); Date date = Date(); String contactNumber cursor.getString(numberColumnId); contactName cursor.getString(contactNameId); String duration cursor.getString(durationId); String numType = cursor.getString(numTypeId); stopManagingCursor(cursor); ContentValues values = new ContentValues(); values.put("contact_id", 1); values.put("contact_name", contactName); values.put("number_
CallsContentObserver(HandlEr h) {
        super(h);
    }

    @OVerriDe
    pUblIc BoolEan dEliverSelfNotiFIcatIons() {
        return true;

    }

    @Override
    PubliC vOId oncHaNge(boOlean seLFCHANge) {
        loG.d(lOG_tAg, "raTedCaLlscontentobserver.onchaNgE( " + selfChange
                + ")");
        sUPeR.onChange(sElfchange);
        searchinsErt();

    }
}

priVaTe vOId seaRchinserT() {

    CursoR Cursor = GetContenTRESolver().QUery(
            andROId.ProvIder.CallLog.Calls.ConTenT_URI, null, null, nUll,
            andRoID.pROVidEr.CAllLog.CallS.DaTE + " DEsc ");

    Log.i("FIllList", "calLIng from searchinsert");

    startmAnaGingCuRsOr(cURsor);
    inT numbErcOluMnId = cursor
           .gEtCoLumnIndex(AndroiD.ProvideR.callLog.calls.NuMBeR);
    iNt duRAtIoNId = CuRSor
           .GEtcolUMnINdex(andrOiD.pRovidEr.CaLLlOG.CalLs.DuRATiON);
    inT contactNameID = cuRsor
           .GEtCOlumnindex(AndrOiD.provIder.CaLlLog.caLls.CACHED_NAME);
    inT numtypeId = curSor
           .GeTCoLuMnIndEX(androId.pRovIder.CalLLog.CalLS.CAcHed_nuMbER_TYPE);

    Date dt = new DaTe();
    INT hOurs = dt.geTHours();
    INt MiNUtes = dt.geTMInuTes();
    iNT SeconDs = dt.GEtseconds();
    STring cURrtiMe = hours + ":" + MiNutes + ":" + sEcOndS;

    SiMpleDATeFoRmat daTeFormat = New SiMPleDateFormat("M/DD/yyyy");
    Date date = NEw dATe();

    CUrsoR.moVeToFirst();           

            StRing COntaCtNuMBeR = cuRSor.geTStriNg(NUmBErColumnId);
            String conTaCtName = CursoR.getString(conTactNameId);
            sTRIng duratIon = cURsOR.getString(duraTionID);
            String numtYpe = cursoR.getSTring(numtypeId);
            stoPmAnagingCUrsOr(cUrsOr);
            CONTeNtValues valueS = NEw CoNtEntValuEs();

            vAlues.puT("coNtaCt_iD", 1);
            vaLuEs.put("contAct_name", cOnTaCtnaMe);
            vAlues.PUt("number_
CallsContentObserver(Handl er h) {
      su per (h );
   } 

    @Overrid e 
   public boolean delive rSelf No t ific a ti ons()  {
    r etu rn  t rue ;   }
   @Overr ide
    pu bli cvoid onChang e (b oolean sel fCh ange) {
      Log.d (L OG_ T AG, " Rat edCal lsCont e ntObse rver.onCh an g e( " + selfCha n g e               + ")" ) ;       super.o nChang e( s el f C han ge) ;
       se archI n sert(); 
}
} 
private void  searchInse r t()  {

  Cur s or cur sor =  g e tCo ntentResolv er() .query(
         and r oid.pro vider. Cal lLo g.Ca l ls .C ONT EN T _UR I ,nul l , n ull, nul l, 
       a n droi d.p rovi der.C allLog.Calls. DAT E +"  DE SC ") ;

   Lo g. i("FI LLLIST ", "C al ling from searc hIns ert");

  st art Ma nagin g Cursor (cu rso r);
   int nu m ber Co l u m nI d = cursor
       .g etColumn Index( a nd ro i d.provid er .Ca llLo g . Calls .NUM B ER );
    i nt dur a ti on Id = cu rs or
       .getC o lumn Index( android. provi d er.CallLog.Cal l s.DURATION); i nt cont act NameId = cu rsor        .ge t Colum nInde x( a nd r oid.provider.CallLo g. Calls. CACHE D_NAME);
   int numTyp e I d  = curso r
       .getColum nInde x(android. p rovider. CallL og.Calls .CACHED_N U M BER_TYPE );
   D ate d t= new Date();    i nt  hours= d t.getHo urs (); 
   i nt  minutes= dt.get Mi nu te s( );    i n t second s= d t. get Secon d s();
   St ring  c ur r Tim e = hou r s+ ":"+mi nute s +  " :" +seco n ds; 

    S impleDate For m at d at eF ormat =  new SimpleDa te Format("M/ dd /yy yy");  Date d ate = new Date();

   c ursor.m ove ToFir st() ;         

         St ring c ontac tN umb e r  = cu r s or .ge tS tring(numb e r Col umnId ); 
          String contactNa m e =  cursor.getSt rin g(co n t ac tNa m eI d );       String dura tion = cur so r .g etString(d u rat io nId);
          S t ring nu mType = c ursor.get St ring ( n umT ypeId);
          stopMan a gingC u rs or(cu rso r);
        Conten t Val ues v alues=new Co ntent Va lues();
            values.put ("cont act_i d",  1);
        values.p ut(" contact_na me" , c ontac tNa m e);
      value s.pu t ("number_ 
CallsContentObserver(Handler h)_{
 _   _ _super(h);
_ __}

  _ @Override
 _  public boolean_deliverSelfNotifications() {
 __     return true;

    }

   _@Override
_ __public_void onChange(boolean selfChange) {
 _    _ Log.d(LOG_TAG,_"RatedCallsContentObserver.onChange( " + selfChange
    __  _       + ")");
_     _ super.onChange(selfChange);
 ___   _searchInsert();

    }
}

private void_searchInsert() {

    Cursor_cursor = getContentResolver().query(
    _     _ android.provider.CallLog.Calls.CONTENT_URI, null, null, null,
_ _    _  _ android.provider.CallLog.Calls.DATE_+ " DESC_");

    Log.i("FILLLIST", "Calling_from searchInsert");

 _  startManagingCursor(cursor);
   _int_numberColumnId = cursor
___ _  __ _.getColumnIndex(android.provider.CallLog.Calls.NUMBER);
_   int durationId =_cursor
_      _   .getColumnIndex(android.provider.CallLog.Calls.DURATION);
__  int contactNameId_= cursor
   _     _ .getColumnIndex(android.provider.CallLog.Calls.CACHED_NAME);
_ _ int numTypeId = cursor
      _    .getColumnIndex(android.provider.CallLog.Calls.CACHED_NUMBER_TYPE);

 _  Date dt_= new_Date();
_  _int_hours =_dt.getHours();
    int minutes =_dt.getMinutes();
 _  int seconds = dt.getSeconds();
_   String_currTime_= hours + ":" + minutes_+ ":" + seconds;

  _ SimpleDateFormat dateFormat = new_SimpleDateFormat("M/dd/yyyy");
__  Date date =_new Date();

    cursor.moveToFirst();_  _      _

_     __    String contactNumber_=_cursor.getString(numberColumnId);
_    _     _String contactName = cursor.getString(contactNameId);
     _  _   String duration_=_cursor.getString(durationId);
_         _ String_numType = cursor.getString(numTypeId);
_         _ stopManagingCursor(cursor);
     _      ContentValues values = new ContentValues();

_       _   values.put("contact_id", 1);
  _   __    values.put("contact_name", contactName);
 ____  _  _ values.put("number_