I want to add functionality of contains()
method in where clause. Right now I was doing something like "address = ?"
and providing address in arguments but now I want to use a logic which works as address.contains(?)
and then providing the address in arguments. How can I implement it?
Till now my code is and need to know the require modification.
Uri mSmsinboxQueryUri = Uri.parse("content://sms");
String[] projection = new String[] { "_id", "thread_id", "address",
"person", "date", "body", "type" };
Cursor cursor1 = getContentResolver().query(mSmsinboxQueryUri,
projection, "address = ?", new String[]{addressToBeSearched}, null);
Try this
Cursor cursor1 = getContentResolver().query(mSmsinboxQueryUri,
projection, "address LIKE ?", new String[]{addressToBeSearched + "%" }, null);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With