您可以使用URI通过
内容解析器进行
删除,也可以通过将某些参数传递给where参数.
如何使参数成为sql注入安全?
是否可以使用Prepared语句与ContentResolver?
act.getContentResolver().delete(myuriwithid,null,null);
act.getContentResolver().delete(mybaseuri," name = '"+this.name"'",null);@H_404_6@
使用位置参数.
public final int delete (Uri url,String where,String[] selectionArgs)@H_404_6@
例如
ContentResolver cr = ...;
String where = "nameid=?";
String[] args = new String[] { "george" };
cr.delete( Stuff.CONTENT_URI,where,args );@H_404_6@