Mẫu Slide_ Cơ bản về lập trinh Android, Cập nhật những mẫu slide đẹp Cập nhật những mẫu slide mới nhất, hot nhất Mẫu slide chi tiết cho bài thuyết trình Slide kiến thức về lập trình Slide lập trình Slide học tập
Trang 1Cơ bản về
& ứng dụng
Trang 2The list items are automatically inserted to the list using an Adapter that pulls content from a source such as an array or database query and converts each item result into a view that's placed into the list.
Android Listview
Trang 3• For an introduction to how you can dynamically insert views using an adapter, read Building Layouts with an Adapter.
Trang 4Using a Loader
Using a CursorLoader is the standard way to query a Cursor as an asynchronous task in order to avoid blocking your app's main thread with the query When the CursorLoader receives the Cursor result, the LoaderCallbacks receives a callback to onLoadFinished(), which is where you update yourAdapter with the new Cursor and the list view then displays the results
Although the CursorLoader APIs were first introduced in Android 3.0 (API level 11), they are also available in the
Support Library so that your app may use them while supporting devices running Android 1.6 or higher
Trang 5• Một ListView được tạo từ một danh sách các ListItem ListItem là một dòng (row) riêng lẻ trong listview nơi mà dữ liệu sẽ được hiển thị Bất kỳ dữ liệu nào trong listview chỉ được hiển thị thông qua listItem Có thể coi listview như là một nhóm cuộn của các ListItem.
Trang 7Adapter (Bộ tiếp nối)
• Android Adapter (Tạm dịch là bộ tiếp nối) là một cầu nối giữa các View (ví dụ như ListView) và các dữ liệu
cơ bản cho View đó Một Adapter quản lý dữ liệu và ghép nối với các dòng riêng lẻ (ListItems) của view
Chúng ta ràng buộc các Adapter với Android ListView thông qua phương thức setAdapter Bây giờ, Chúng ta
hãy xem làm thế nào Adapter làm việc với sự giúp đỡ của hình ảnh sau đây.
Trang 10AdapterView
Trang 12ListView Selector
• ListView hiển thị đẹp hơn, bạn cần phải tùy biến các hiệu ứng
Trang 13ListView cơ bản sử dụng ArrayAdapter
• ArrayAdapter sử dụng để hiển thị các ListView với các ListItem đơn giản, ListItem có thể làm
từ duy nhất một TextView, CheckedTextView, EditText,
Trang 15Ví dụ ListView với ArrayAdapter