本文整理汇总了Java中android.widget.AlphabetIndexer.setCursor方法的典型用法代码示例。如果您正苦于以下问题:Java AlphabetIndexer.setCursor方法的具体用法?Java AlphabetIndexer.setCursor怎么用?Java AlphabetIndexer.setCursor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.widget.AlphabetIndexer
的用法示例。
在下文中一共展示了AlphabetIndexer.setCursor方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: index
import android.widget.AlphabetIndexer; //导入方法依赖的package包/类
public Cursor index(Cursor cursor){
if(cursor != null){
mRowStates = new int[cursor.getCount()];
mAlphaIndexer = new AlphabetIndexer(cursor,
1,
mAlphabet);
mAlphaIndexer.setCursor(cursor);
Arrays.fill(mRowStates, STATE_UNKNOWN);
} else {
mRowStates = new int[0];
mAlphaIndexer = null;
}
if(mRowStates.length > 0)
mRowStates[0] = STATE_LABELED;
return cursor;
}
示例2: swapCursor
import android.widget.AlphabetIndexer; //导入方法依赖的package包/类
@Override
public Cursor swapCursor(Cursor newCursor) {
Cursor oldCursor = super.swapCursor(newCursor);
// Create an indexer for the first time, indexing on domain.
if (newCursor != null) {
mAlphabetIndexer = new AlphabetIndexer(newCursor, newCursor.getColumnIndex(Secret.DOMAIN), ALPHABET);
}
// Update an existing indexer with the latest cursor.
if (mAlphabetIndexer != null) {
mAlphabetIndexer.setCursor(newCursor);
}
return oldCursor;
}
示例3: swapCursor
import android.widget.AlphabetIndexer; //导入方法依赖的package包/类
@Override
public Cursor swapCursor(Cursor newCursor) {
if(newCursor != null && !newCursor.isClosed()){
indexer = new AlphabetIndexer(newCursor,
newCursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME),
" ABCDEFGHIJKLMNOPQRTSUVWXYZ0123456789");
}else{
indexer.setCursor(newCursor);
}
return super.swapCursor(newCursor);
}
示例4: init
import android.widget.AlphabetIndexer; //导入方法依赖的package包/类
private void init(Cursor c) {
if (c == null) {
return;
}
//mWrapper = new PatientWrapper(c);
//c.setNotificationUri(context.getContentResolver(), Patients.CONTENT_URI);
mRowStates = new int[c.getCount()];
Arrays.fill(mRowStates, STATE_UNKNOWN);
if(mRowStates.length > 0)
mRowStates[0] = STATE_LABELED;
mAlphaIndexer = new AlphabetIndexer(c,
1,
mAlphabet);
mAlphaIndexer.setCursor(c);
}
示例5: SpeciesGroupListCursorAdapter
import android.widget.AlphabetIndexer; //导入方法依赖的package包/类
public SpeciesGroupListCursorAdapter(Context context, Cursor c, int flags) {
super(context, c, flags);
mAlphabetIndexer = new AlphabetIndexer(c,
c.getColumnIndex(FieldGuideDatabase.SPECIES_GROUP),
" ABCDEFGHIJKLMNOPQRTSUVWXYZ");
mAlphabetIndexer.setCursor(c);
}
示例6: SpeciesCursorAdapter
import android.widget.AlphabetIndexer; //导入方法依赖的package包/类
public SpeciesCursorAdapter(Context context, Cursor c, int flags) {
super(context, c, flags);
mAlphabetIndexer = new AlphabetIndexer(c,
c.getColumnIndex(FieldGuideDatabase.SPECIES_GROUP),
" ABCDEFGHIJKLMNOPQRTSUVWXYZ");
mAlphabetIndexer.setCursor(c);
}
示例7: AlphabetIndexerCursorAdapter
import android.widget.AlphabetIndexer; //导入方法依赖的package包/类
public AlphabetIndexerCursorAdapter(Bundle savedInstanceState, Context context, Cursor cursor) {
super(savedInstanceState, context, R.layout.mca__simple_list_item_checkable_1, cursor, FROM, TO, 0);
// Sets a new cursor as the data set and resets the cache of indices.
int columnIndex = cursor.getColumnIndex(BuildingsContract.NAME);
alphabetIndexer = new AlphabetIndexer(cursor, columnIndex, " ABCDEFGHIJKLMNOPQRTSUVWXYZ");
alphabetIndexer.setCursor(cursor);
}
示例8: SpeciesListCursorAdapter
import android.widget.AlphabetIndexer; //导入方法依赖的package包/类
public SpeciesListCursorAdapter(Context context, Cursor c, int flags) {
super(context, c, flags);
mAlphabetIndexer = new AlphabetIndexer(c, c.getColumnIndex(FieldGuideDatabase.SPECIES_LABEL), " ABCDEFGHIJKLMNOPQRTSUVWXYZ");
mAlphabetIndexer.setCursor(c);
}