Created
September 15, 2014 07:05
-
-
Save chiemy/fe4ec89f7e6e68b01838 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Defines a list of columns to retrieve from the Cursor and load into an output row | |
String[] mWordListColumns ={ | |
UserDictionary.Words.WORD, // Contract class constant containing the word column name UserDictionary.Words.LOCALE // Contract class constant containing the locale column name | |
}; | |
// Defines a list of View IDs that will receive the Cursor columns for each row | |
int[] mWordListItems = { R.id.dictWord, R.id.locale}; | |
// Creates a new SimpleCursorAdapter | |
mCursorAdapter = new SimpleCursorAdapter( | |
getApplicationContext(), // 上下文对象 | |
R.layout.wordlistrow, // ListView的Item(一行) | |
mCursor, // 查询结果 | |
mWordListColumns, // cursor中列名数组 | |
mWordListItems, // 在Item布局中,每个View的id | |
0); // Flags (usually none are needed) | |
// 为ListView设置适配器 | |
mWordList.setAdapter(mCursorAdapter); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment