can anyone explain what the use of the parameters 3 and 4 in managedQuery while using content providers.
Thanks in advance.

i saw this site (http://app-solut.com/blog/2011/03/working-with-the-contactscontract-to-query-contacts-in-android/)

but i am not clear with the 3 rd and 4th parameters.
Can we use contact name as a selection clause like Contact.Display_NAME+="?" in the 3rd parameter and name (a variable whose value is taken from the edittext field of xml file) in the 4th parameter ?

please help me..

Edited by sharathg.satya: Spell mistake

6 Years
Discussion Span
Last Post by peter_budo

Look at Activity [managedQuery](http://developer.android.com/reference/android/app/Activity.html#managedQuery(android.net.Uri, java.lang.String[], java.lang.String, java.lang.String[], java.lang.String)) for more info. Quick cut would be as bellow

uri The URI of the content provider to query.
projection List of columns to return.
selection SQL WHERE clause.
selectionArgs The arguments to selection, if any ?s are pesent
sortOrder SQL ORDER BY clause.

PS: Be aware Activity.managedQuery been deprecated and you should ue CursorLoader

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.