Where is the sentence in the contentProvider request in Android

I want to add the functionality of the contains() method to where where. Right now I was doing something like "address = ?" and provided the address in arguments, but now I want to use logic that works like address.contains(?) , and then provides the address in arguments. How can i implement this? So far, my code is and should know that a modification is required.

 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); 
+6
source share
1 answer

try it

 Cursor cursor1 = getContentResolver().query(mSmsinboxQueryUri, projection, "address LIKE ?", new String[]{addressToBeSearched + "%" }, null); 
+10
source

Source: https://habr.com/ru/post/945929/


All Articles