cevap

1

varsayılan bir kişi gözlemci .. Sana

public class MyCOntentObserver extends ContentObserver { 
     public MyCOntentObserver() { 
      super(null); 
     } 

     @Override 
     public void onChange(boolean selfChange) { 
      super.onChange(selfChange); 
      final int currentCount = getContactCount(); 

      // Get count from your sqlite database 
      int mContactCount = getContactOWNCount(); 

      if (currentCount < mContactCount) { 
       // DELETE HAPPEN. 
       Log.e("Status", "Deletion"); 
       //contactDBOperaion.SyncContacts(1); 
      } else if (currentCount == mContactCount) { 
       // UPDATE HAPPEN. 
       // contactDBOperaion.SyncContacts(0); 
      } else { 
       // INSERT HAPPEN. 
       Log.e("Status", "Insertion"); 
       // contactDBOperaion.SyncContacts(2); 
      } 
      Log.e("", "~~~~~~" + selfChange); 
     } 

     @Override 
     public boolean deliverSelfNotifications() { 
      return true; 
     } 
    } 
için yararlı umut var
İlgili konular