Android Development Series logs-(3)

Source: Internet
Author: User

I. Database
1. add, delete, modify, and query *****
Insert () specifies the table name and a map set containing data (contentvalues). To prevent the set from being empty, you can also specify a column name. The ID is returned after insertion.
Delete () specifies the table name and query conditions. After deletion, the number of affected records is returned.
Update () specifies the table name, dataset, and query conditions. The number of affected records is returned after the update.
Query () specifies the table name, queried column name, query conditions, grouping conditions, sorting conditions, paging conditions, and so on.
2. Transaction Management *
Begintransaction () starts a transaction
Settransactionsuccessful (): transaction set successfully
The endtransaction () ends the transaction. Whether or not the transaction is explicitly called, the transaction ends. When the transaction ends, it is set to successfully mark the previous operation commit, and unset operations will be rolled back.

Ii. listview
1. Create *
Baseadapter ***
The custom class inherits the baseadapter and overwrites four abstract methods. The getview () method generates view responses based on the layout file. To improve the efficiency, convertview can be reused.
Simpleadapter
Directly create an object and pass in the data list <Map <string,?>, Layout File ID, relationship between data and interface string [] and INT []
Simplecursoradapter
Directly create an object and pass in the layout File ID, including the data cursor, the relationship between the data and the interface string [] and INT []
2. event listening *
Baseadapter
Setonitemclicklistener (): In the listener, call the parent. getitematposition () method to obtain the object returned by the getitem () method in the Custom adapter.
Simpleadapter
The parent. getitematposition () method obtains a map at a specified position.
Simplecursoradapter
The parent. getitematposition () method gets a cursor that has been moved to the specified position.

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.