|
100精币
var [color=#9c*Fe]cursor = [color=#9c*Fe]context.getContentResolver().query([color=#9c*Fe]android.[color=#9c*Fe]provider.[color=#9c*Fe]ContactsContract.[color=#9c*Fe]CommonDataKinds.[color=#9c*Fe]Phone.CONTENT_URI, null, null, null, null);
while ([color=#9c*Fe]cursor.moveToNext()) {
//获取ID
var [color=#9c*Fe]rawId = [color=#9c*Fe]cursor.getString([color=#9c*Fe]cursor.getColumnIndex([color=#9c*Fe]android.[color=#9c*Fe]provider.[color=#9c*Fe]ContactsContract.[color=#9c*Fe]Contacts.[color=#9c*Fe]_ID));
log([color=#9c*Fe]rawId);
//删除
var [color=#9c*Fe]where = [color=#9c*Fe]android.[color=#9c*Fe]provider.[color=#9c*Fe]ContactsContract.[color=#9c*Fe]Data.[color=#9c*Fe]_ID + " =?";
var [color=#9c*Fe]whereparams = [];
[color=#9c*Fe]whereparams.push([color=#9c*Fe]rawId)
[color=#9c*Fe]whereparams.forEach([color=#9c*Fe]item => {
log([color=#9c*Fe]item);
})
[color=#9c*Fe]context.getContentResolver().delete([color=#9c*Fe]android.[color=#9c*Fe]provider.[color=#9c*Fe]ContactsContract.[color=#9c*Fe]RawContacts.CONTENT_URI, [color=#9c*Fe]where, [color=#9c*Fe]whereparams);
}
if ([color=#9c*Fe]cursor != null) {
[color=#9c*Fe]cursor.close();
}
//用的是autojs
|
求助知识:请将问题描述清楚,最好把你有问题的源码打包上传上来,这样更方便大家帮助你。 友情提醒:本版被采纳的主题可在 申请荣誉值 帖子申请荣誉值,获得 3点 荣誉值,荣誉值可兑换荣誉会员、终身vip用户组。
|