calllog

Android Get Contact Picture from Call Log

こ雲淡風輕ζ 提交于 2019-12-18 05:16:31
问题 It was pretty easy to get the Contact picture when querying the People.CONTENT_URI , with a simple People.loadContactPhoto(activity, ContentUris.withAppendedId(People.CONTENT_URI, contactId) because I knew the contact Id. Now I need to do the same thing after accesing the Call log. With: String[] strFields = { android.provider.CallLog.Calls.CACHED_NAME, android.provider.CallLog.Calls.NUMBER, }; String strUriCalls="content://call_log/calls"; Uri UriCalls = Uri.parse(strUriCalls); Cursor

Delete call log in android for particular number

若如初见. 提交于 2019-12-17 16:41:48
问题 I am trying to delete all call logs of particular number. try { String strNumberOne[] = {number}; Cursor cursor = getContentResolver().query(CallLog.Calls.CONTENT_URI, null, CallLog.Calls.NUMBER + "=? ", strNumberOne, ""); boolean bol = cursor.moveToFirst(); if (bol) { do { int idOfRowToDelete = cursor.getInt(cursor.getColumnIndex(CallLog.Calls._ID)); getContentResolver().delete(Uri.withAppendedPath(CallLog.Calls.CONTENT_URI, String.valueOf(idOfRowToDelete)), "", null); } while (cursor

Delete call log in android for particular number

天大地大妈咪最大 提交于 2019-12-17 16:41:23
问题 I am trying to delete all call logs of particular number. try { String strNumberOne[] = {number}; Cursor cursor = getContentResolver().query(CallLog.Calls.CONTENT_URI, null, CallLog.Calls.NUMBER + "=? ", strNumberOne, ""); boolean bol = cursor.moveToFirst(); if (bol) { do { int idOfRowToDelete = cursor.getInt(cursor.getColumnIndex(CallLog.Calls._ID)); getContentResolver().delete(Uri.withAppendedPath(CallLog.Calls.CONTENT_URI, String.valueOf(idOfRowToDelete)), "", null); } while (cursor

Delete particular log from call log

寵の児 提交于 2019-12-13 22:33:04
问题 I want to delete a particular entry from call log only once.. getActivity().getContentResolver().delete(calluri, queryString, null); The above code delete all the entries from call log 回答1: try do delete call log by call id. use below code int res = Call_logs.this.getContentResolver().delete(android.provider.CallLog.Calls.CONTENT_URI,"_ID = "+ calls_id_list.get(i),null); if (res == 1) { // Log delete } else { // Log not Delete } to delete all call log: Uri uri = Uri.parse("content://call_log

How to access MISSED_CALL Log in Android

狂风中的少年 提交于 2019-12-13 04:02:37
问题 I am developing an app in which i want to access MISSED_CALL log. Using below code.... private Cursor getItemsToSync() { G = "Log method accessing"; ContentResolver r = getContentResolver(); String selections = String.format("%s > ?", CallLog.Calls.DATE,CallLog.Calls.MISSED_TYPE); String[] selectionArgs = new String[] { String.valueOf(getMaxSyncedDate())}; String sortOrder = SmsConsts.DATE + " LIMIT " + PrefStore.getMaxItemsPerSync(this); N = CallLog.Calls.CACHED_NAME; return r.query(Uri

CallLog content provider returns 500 results max

穿精又带淫゛_ 提交于 2019-12-13 02:47:28
问题 For some reason, If I query the CallLog Content provider, I get maximum 500 results. Also, it seems I only get results up to 1 month ago (when my devices Phone app shows me about 8 months at the moment). I googled it, but all I found was 'Store 'CallLog.Calls' into another table' which offers no solution. This is my code: String[] strFields = { android.provider.CallLog.Calls.NUMBER, android.provider.CallLog.Calls.DURATION, android.provider.CallLog.Calls.DATE, }; Cursor cursor =

Can't remove SMS logs from call log on Samsung devices

谁都会走 提交于 2019-12-12 15:41:26
问题 I'm trying to remove all SMS messages from the device via my app, but for some reason SMS logs still appear on the call log on some of the Samsung devices. I've tried a more "radical" approach, and deleted the following URI's using the ContentResolver : content://call_log/calls content://sms content://sms/inbox content://sms/sent content://mms/inbox content://mms content://mms-sms content://mms/address content://mms/part content://mms/sent content://mms/outbox Delete was done with the

Android date from calllog results in strange form

人盡茶涼 提交于 2019-12-12 06:28:55
问题 I am collecting dates of calls from the Calllog, but there is a problem with the dates. I used simpledateformat to format the numbers, but i get false data: years from 1903 to 1948 and from 1954-2036. This is the code I am using: final Context context = getApplicationContext(); final String[] projection = null; final String selection = android.provider.CallLog.Calls.NUMBER + "='+3620455351684'"; final String[] selectionArgs = null; final String sortOrder = android.provider.CallLog.Calls.DATE

Get calls from log by specific SIM

徘徊边缘 提交于 2019-12-12 02:00:07
问题 I want to get calls from Android CallLog.Calls which were made from a specific SIM. Is there's a way to check which SIM was used to make call? The following method allows to check SIM when call is performed and app is running. (TelephonyManager)getSystemService(Context.TELEPHONY_SERVICE).getSimSerialNumber(); How to check which SIM was used to make calls before app is installed? 回答1: In the CallLog.Calls class, there don't seems any field that keeps SIM Information (like which SIM is used

Android ContentObserver never stopped

雨燕双飞 提交于 2019-12-11 04:22:42
问题 I implemented a ContentObserver and it worked fine. But now everytime the ContentObserver is notified for some changes in the CallLog.Calls content provider, it runs the onChange() method without stopping. I'd like that my observer runs once for each item that has changed in the content provider. So, if 5 new items have been added to the CallLog.Calls content provider, the observer must be notified 5 times, and for each notify to the observer, a new call to the onChange() method must happen.