当前位置: 首页>>代码示例>>Java>>正文


Java SimpleCursorAdapter.setFilterQueryProvider方法代码示例

本文整理汇总了Java中android.widget.SimpleCursorAdapter.setFilterQueryProvider方法的典型用法代码示例。如果您正苦于以下问题:Java SimpleCursorAdapter.setFilterQueryProvider方法的具体用法?Java SimpleCursorAdapter.setFilterQueryProvider怎么用?Java SimpleCursorAdapter.setFilterQueryProvider使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.widget.SimpleCursorAdapter的用法示例。


在下文中一共展示了SimpleCursorAdapter.setFilterQueryProvider方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: initDomainPasswordEntry

import android.widget.SimpleCursorAdapter; //导入方法依赖的package包/类
private void initDomainPasswordEntry() {
    mDomainEdit = (AutoCompleteTextView) findViewById(R.id.domain_edit);

    mMasterPwEdit = ((VisualHashEditText) findViewById(R.id.password_edit));

    mMasterPwEdit.setOnEditorActionListener(this);

    final SimpleCursorAdapter adapter = new SimpleCursorAdapter(this,
            android.R.layout.simple_dropdown_item_1line, null, new String[] { "domain" },
            new int[] { android.R.id.text1 });

    adapter.setFilterQueryProvider(this);
    adapter.setStringConversionColumn(DOMAIN_COLUMN);

    // initialize the autocompletion
    mDomainEdit.setOnItemClickListener(new OnItemClickListener() {

        @Override
        public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
            mMasterPwEdit.requestFocus();
        }
    });
    mDomainEdit.setAdapter(adapter);
}
 
开发者ID:pdudits,项目名称:supergenpass-android,代码行数:25,代码来源:Super_Gen_Pass.java

示例2: initDomainPasswordEntry

import android.widget.SimpleCursorAdapter; //导入方法依赖的package包/类
private void initDomainPasswordEntry() {
    mDomainEdit = (AutoCompleteTextView) findViewById(R.id.domain_edit);

    mMasterPwEdit = (VisualHashEditText) findViewById(R.id.password_edit);

    mMasterPwEdit.setOnEditorActionListener(this);

    final SimpleCursorAdapter adapter =
            new SimpleCursorAdapter(this, android.R.layout.simple_dropdown_item_1line, null,
                    new String[] { "domain" }, new int[] { android.R.id.text1 },
                    CursorAdapter.FLAG_REGISTER_CONTENT_OBSERVER);

    adapter.setFilterQueryProvider(this);
    adapter.setStringConversionColumn(DOMAIN_COLUMN);

    // initialize the autocompletion
    mDomainEdit.setOnItemClickListener(new OnItemClickListener() {

        @Override
        public void onItemClick(final AdapterView<?> arg0, final View arg1, final int arg2,
                final long arg3) {
            mMasterPwEdit.requestFocus();
        }
    });
    mDomainEdit.setAdapter(adapter);
}
 
开发者ID:xxv,项目名称:SuperGenPass,代码行数:27,代码来源:Super_Gen_Pass.java

示例3: getAutoCompleteAdapter

import android.widget.SimpleCursorAdapter; //导入方法依赖的package包/类
/**
 * @param context this
 * @param layout  support_simple_spinner_dropdown_item
 * @return
 */
public ListAdapter getAutoCompleteAdapter(Context context, int layout) {
    SimpleCursorAdapter adapter =
            new SimpleCursorAdapter(context, layout,
                    null,
                    new String[]{FIELD_HWD},
                    new int[]{android.R.id.text1},
                    0
            );
    adapter.setFilterQueryProvider(
            new FilterQueryProvider() {
                @Override
                public Cursor runQuery(CharSequence constraint) {
                    return getFilterCursor(constraint.toString());
                }
            }
    );
    adapter.setCursorToStringConverter(
            new SimpleCursorAdapter.CursorToStringConverter() {
                @Override
                public CharSequence convertToString(Cursor cursor) {
                    return cursor.getString(1);
                }
            }
    );

    return adapter;
}
 
开发者ID:mmjang,项目名称:quiz_helper,代码行数:33,代码来源:Collins.java

示例4: getAutoCompleteAdapter

import android.widget.SimpleCursorAdapter; //导入方法依赖的package包/类
public ListAdapter getAutoCompleteAdapter(Context context, int layout) {
    SimpleCursorAdapter adapter =
            new SimpleCursorAdapter(context, layout,
                    null,
                    new String[]{"hwd"},
                    new int[]{android.R.id.text1},
                    0
            );
    adapter.setFilterQueryProvider(
            new FilterQueryProvider() {
                @Override
                public Cursor runQuery(CharSequence constraint) {
                    return getFilterCursor(constraint.toString());
                }
            }
    );
    adapter.setCursorToStringConverter(
            new SimpleCursorAdapter.CursorToStringConverter() {
                @Override
                public CharSequence convertToString(Cursor cursor) {
                    return cursor.getString(1);
                }
            }
    );

    return adapter;
}
 
开发者ID:mmjang,项目名称:quiz_helper,代码行数:28,代码来源:WebsterLearners.java

示例5: getAutoCompleteAdapter

import android.widget.SimpleCursorAdapter; //导入方法依赖的package包/类
@Override
public ListAdapter getAutoCompleteAdapter(Context context, int layout) {
    SimpleCursorAdapter adapter =
            new SimpleCursorAdapter(context, layout, null,
                    new String[] {CustomDictionaryDbHelper.getHeadwordColumnName()},
                    new int[] {android.R.id.text1},
                    0
                    );
    adapter.setFilterQueryProvider(
            new FilterQueryProvider() {
                @Override
                public Cursor runQuery(CharSequence constraint) {
                    return mDbHelper.getFilterCursor(mDictId, constraint.toString());
                }
            }
    );

    adapter.setCursorToStringConverter(
            new SimpleCursorAdapter.CursorToStringConverter() {
                @Override
                public CharSequence convertToString(Cursor cursor) {
                    return cursor.getString(1);
                }
            }
    );

    return adapter;
}
 
开发者ID:mmjang,项目名称:quiz_helper,代码行数:29,代码来源:CustomDictionary.java


注:本文中的android.widget.SimpleCursorAdapter.setFilterQueryProvider方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。