當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。