Example usage for android.app SearchManager SUGGEST_COLUMN_TEXT_2_URL

List of usage examples for android.app SearchManager SUGGEST_COLUMN_TEXT_2_URL

Introduction

In this page you can find the example usage for android.app SearchManager SUGGEST_COLUMN_TEXT_2_URL.

Prototype

String SUGGEST_COLUMN_TEXT_2_URL

To view the source code for android.app SearchManager SUGGEST_COLUMN_TEXT_2_URL.

Click Source Link

Document

Column name for suggestions cursor.

Usage

From source file:com.aboveware.sms.contacts.ContactSuggestionsAdapter.java

/**
 * Cache columns.// w  w  w  .j av  a2 s .  co m
 */
@SuppressLint("InlinedApi")
@Override
public void changeCursor(Cursor c) {
    if (DBG)
        Log.d(LOG_TAG, "changeCursor(" + c + ")");

    if (mClosed) {
        Log.w(LOG_TAG, "Tried to change cursor after adapter was closed.");
        if (c != null)
            c.close();
        return;
    }

    try {
        super.changeCursor(c);

        if (c != null) {
            mText1Col = c.getColumnIndex(SearchManager.SUGGEST_COLUMN_TEXT_1);
            mText2Col = c.getColumnIndex(SearchManager.SUGGEST_COLUMN_TEXT_2);
            mText2UrlCol = c.getColumnIndex(SearchManager.SUGGEST_COLUMN_TEXT_2_URL);
            c.getColumnIndex(SearchManager.SUGGEST_COLUMN_ICON_1);
            mIconName2Col = c.getColumnIndex(SearchManager.SUGGEST_COLUMN_ICON_2);
            mFlagsCol = c.getColumnIndex(SearchManager.SUGGEST_COLUMN_FLAGS);
        }
    } catch (Exception e) {
        Log.e(LOG_TAG, "error changing cursor and caching columns", e);
    }
}

From source file:android.support.v7.widget.SuggestionsAdapter.java

/**
 * Cache columns.//from  w w  w .j av a  2 s  .  c  om
 */
@Override
public void changeCursor(Cursor c) {
    if (DBG)
        Log.d(LOG_TAG, "changeCursor(" + c + ")");

    if (mClosed) {
        Log.w(LOG_TAG, "Tried to change cursor after adapter was closed.");
        if (c != null)
            c.close();
        return;
    }

    try {
        super.changeCursor(c);

        if (c != null) {
            mText1Col = c.getColumnIndex(SearchManager.SUGGEST_COLUMN_TEXT_1);
            mText2Col = c.getColumnIndex(SearchManager.SUGGEST_COLUMN_TEXT_2);
            mText2UrlCol = c.getColumnIndex(SearchManager.SUGGEST_COLUMN_TEXT_2_URL);
            mIconName1Col = c.getColumnIndex(SearchManager.SUGGEST_COLUMN_ICON_1);
            mIconName2Col = c.getColumnIndex(SearchManager.SUGGEST_COLUMN_ICON_2);
            mFlagsCol = c.getColumnIndex(SearchManager.SUGGEST_COLUMN_FLAGS);
        }
    } catch (Exception e) {
        Log.e(LOG_TAG, "error changing cursor and caching columns", e);
    }
}