Public final Cursor query () parameter resolution

Source: Internet
Author: User
  • Public final Cursor query (Uri URI, string[] projection,string selection,string[] Selectionargs, Stringsortorder)

    The first argument, the URI is a unique identifier used to identify the provider to be accessed

    The second argument, projection, tells the provider what to return (column columns of course, you can only display name when printed below, because the result you return does not include an ID.)

    Returns all the contents of the provider, in columns column, with NULL.

    The third parameter, selection, sets the condition, which is equivalent to where in the SQL statement. Null means no filtering is performed. To obtain a name equal to Zhang San, use "= ' Zhang San '" instead

    Fourth parameter, Selectionargs, this parameter is to be used with the third parameter, if the third parameter is set to have? , then the data written in Selectionargs will be replaced?? It's actually a placeholder, and it's easy to understand that it's written in a SQL statement.

    The fifth parameter, SortOrder, is sorted by what, equivalent to the order by in the SQL statement. You can set the "DESC" "ASC"; the default is ascending

    Ascending, in fact the default sort is ascending, + "ASC" does not write the same effect:


Public final Cursor query () parameter resolution

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.