The difference between managedquery and query,

Source: Internet
Author: User
Tags sqlite database

We all know that in the Android system, the relevant operation of the SQLite database is encapsulated as content Provider, can help those who do not have SQL language developers quickly implement the database operation on the Android platform, However, we usually return the cursor object when we query, in essence, these two APIs are provided by different classes. Android123 hints such as contentresolver.query (), and activity.managedquery () so, we see a query method that is provided by Contentresolver, is located in Android.content.ContextWrapper.getContentResolver () and the other is activity.

The parameters of the two methods are the same, but the activity class's methods are affected by the activity throughout the declaration cycle, while conventional processing of the data logic may be separated into a single class, passing the instance handle directly using the context object, while the Android Development Network also suggests that For database query operations if the data is large, use the asynchronous Asyncqueryhandler method to prevent blocking the thread as much as possible.

This article link: http://www.elexcon.com/news/54294.html

The difference between managedquery and query,

Related Article

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.