Eby
1:09 PM
Hey
 
@Eby hey!!
@Eby you there?
 
Eby
yes dude
U can get timestamp in onChange()
 
so. how is that solution you proposed?
 
Eby
make a DB call
 
how is that
here is my onChange()
@Override
            public void onChange(boolean selfChange) {

                super.onChange(selfChange);
                Log.i(LOG_TAG, "Inside on Change. selfChange " + selfChange);
                searchInsert();
            }
 
Eby
1:19 PM
@Override
public void onChange(boolean selfChange) {

super.onChange(selfChange);
Log.i(LOG_TAG, "Inside on Change. selfChange " + selfChange);
searchInsert();
}
wait.. that was a mistake
 
yes. how would be the implementing?
 
Eby
public void onChange(boolean selfChange) {

super.onChange(selfChange);
// make a DB call and check the last TS inseted.. if it is same skip searchInsert();
searchInsert();
}
 
what is this timestamp
you mean make a select in the table and get the timestamp, and compare to what?
 
Eby
and compare to the latest timestamp in the call database
 
what is the timestamp
is it a column?
how do i retrieve that?
 
Eby
1:23 PM
android.provider.CallLog.Calls.DATE
 
and??
 
Eby
getContentResolver().query(
android.provider.CallLog.Calls.CONTENT_URI, cols,
android.provider.CallLog.Calls.DATE + " > " + lastDate,
null, android.provider.CallLog.Calls.DATE + " ASC");
 
if the date is the same it means its the same register
 
Eby
where last data is the last TS inserted in the table
 
I have to create a new column in the table?
this android.provider.CallLog.Calls.DATE has the date and the hour?
 
Eby
1:24 PM
ya if the date is the same it means its the same register so no need to register it again
 
android.provider.CallLog.Calls.DATE has the date and time of the register??
 
Eby
yes.. i think "android.provider.CallLog.Calls.DATE" has Timestamp
 
you used this for your app?
how did you implemented onChange()?
 
Eby
yes
 
you did this way with onChange()?
 
Eby
1:26 PM
Yes Dude...
 
ok. very good
 
Eby
Im not remembering this exactly.. but almost sure
 
Im not with my computer here, im in job. Ill have to got home to try that.
you can post the answer on the question if you want
 
Eby
i guess we had a discussion few months ago in the same topic
 
3
Q: ContentObserver onChange() repeats multiple times.

cyberrogI haven't found any solution for this problem in the bunch of questions and reference I've searched. So here is. I'm trying to query the data from the CallLog and insert in DB. For that, I've created a COntentObserver as inner class in a Service, and inside onChange() method, I call my method...

I dont remember
 
Eby
1:28 PM
hmm thats how we met in StackOverFlow
 
@Eby yeah!
 
Eby
so when is the scheduled launch of your app
 
i just need to solve it =/
and its done
 
Eby
Wow!!! cool..
im planning to leave office..! its friday night im gonna enjoy ;)
bye.. im leaving the room