android - ContentResolver returns outdated data -
the next code should homecoming lastly phone number in phone call log.
it works, returns not lastly phone number, sec last. if check list of calls, can see number returned not lastly in history. running programme 1 time again homecoming lastly ("correct") number.
can tell what's wrong?
private string getphonenumber() { string[] projection = {calllog.calls.number}; cursor calllog = getcontentresolver().query( calllog.calls.content_uri, projection, null, null, calllog.calls.default_sort_order ); // set number calllog.movetofirst(); homecoming calllog.getstring(calllog.getcolumnindex(calllog.calls.number)); } android android-contentprovider android-contentresolver
No comments:
Post a Comment