Example usage for android.app SearchManager ACTION_MSG

List of usage examples for android.app SearchManager ACTION_MSG

Introduction

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

Prototype

String ACTION_MSG

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

Click Source Link

Document

Intent extra data key: Use this key with Intent.ACTION_SEARCH and android.content.Intent#getStringExtra content.Intent.getStringExtra() to obtain the action message that was defined for a particular search action key and/or suggestion.

Usage

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

/**
 * Constructs an intent from the given information and the search dialog state.
 *
 * @param action Intent action./*from w  w w.  j av  a  2 s  . c om*/
 * @param data Intent data, or <code>null</code>.
 * @param extraData Data for {@link SearchManager#EXTRA_DATA_KEY} or <code>null</code>.
 * @param query Intent query, or <code>null</code>.
 * @param actionKey The key code of the action key that was pressed,
 *        or {@link KeyEvent#KEYCODE_UNKNOWN} if none.
 * @param actionMsg The message for the action key that was pressed,
 *        or <code>null</code> if none.
 * @return The intent.
 */
private Intent createIntent(String action, Uri data, String extraData, String query, int actionKey,
        String actionMsg) {
    // Now build the Intent
    Intent intent = new Intent(action);
    intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    // We need CLEAR_TOP to avoid reusing an old task that has other activities
    // on top of the one we want. We don't want to do this in in-app search though,
    // as it can be destructive to the activity stack.
    if (data != null) {
        intent.setData(data);
    }
    intent.putExtra(SearchManager.USER_QUERY, mUserQuery);
    if (query != null) {
        intent.putExtra(SearchManager.QUERY, query);
    }
    if (extraData != null) {
        intent.putExtra(SearchManager.EXTRA_DATA_KEY, extraData);
    }
    if (mAppSearchData != null) {
        intent.putExtra(SearchManager.APP_DATA, mAppSearchData);
    }
    if (actionKey != KeyEvent.KEYCODE_UNKNOWN) {
        intent.putExtra(SearchManager.ACTION_KEY, actionKey);
        intent.putExtra(SearchManager.ACTION_MSG, actionMsg);
    }
    if (IS_AT_LEAST_FROYO) {
        intent.setComponent(mSearchable.getSearchActivity());
    }
    return intent;
}

From source file:cm.aptoide.com.actionbarsherlock.widget.SearchView.java

/**
 * Constructs an intent from the given information and the search dialog state.
 *
 * @param action Intent action.//from ww  w  . ja v a2  s.co  m
 * @param data Intent data, or <code>null</code>.
 * @param extraData Data for {@link SearchManager#EXTRA_DATA_KEY} or <code>null</code>.
 * @param query Intent query, or <code>null</code>.
 * @param actionKey The key code of the action key that was pressed,
 *        or {@link KeyEvent#KEYCODE_UNKNOWN} if none.
 * @param actionMsg The message for the action key that was pressed,
 *        or <code>null</code> if none.
 * @return The intent.
 */
private Intent createIntent(String action, Uri data, String extraData, String query, int actionKey,
        String actionMsg) {
    // Now build the Intent
    Intent intent = new Intent(action);
    intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    // We need CLEAR_TOP to avoid reusing an old task that has other activities
    // on top of the one we want. We don't want to do this in in-app search though,
    // as it can be destructive to the activity stack.
    if (data != null) {
        intent.setData(data);
    }
    intent.putExtra(SearchManager.USER_QUERY, mUserQuery);
    if (query != null) {
        intent.putExtra(SearchManager.QUERY, query);
    }
    if (extraData != null) {
        intent.putExtra(SearchManager.EXTRA_DATA_KEY, extraData);
    }
    if (mAppSearchData != null) {
        intent.putExtra(SearchManager.APP_DATA, mAppSearchData);
    }
    if (actionKey != KeyEvent.KEYCODE_UNKNOWN) {
        intent.putExtra(SearchManager.ACTION_KEY, actionKey);
        intent.putExtra(SearchManager.ACTION_MSG, actionMsg);
    }
    intent.setComponent(mSearchable.getSearchActivity());
    return intent;
}

From source file:com.example.navigationsearchview.NavigationSearchView.java

/**
 * Constructs an intent from the given information and the search dialog
 * state./*from  w ww .  j  av  a 2s .  c  o  m*/
 *
 * @param action
 *            Intent action.
 * @param data
 *            Intent data, or <code>null</code>.
 * @param extraData
 *            Data for {@link SearchManager#EXTRA_DATA_KEY} or
 *            <code>null</code>.
 * @param query
 *            Intent query, or <code>null</code>.
 * @param actionKey
 *            The key code of the action key that was pressed, or
 *            {@link KeyEvent#KEYCODE_UNKNOWN} if none.
 * @param actionMsg
 *            The message for the action key that was pressed, or
 *            <code>null</code> if none.
 * @return The intent.
 */
private Intent createIntent(String action, Uri data, String extraData, String query, int actionKey,
        String actionMsg) {
    // Now build the Intent
    Intent intent = new Intent(action);
    intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    // We need CLEAR_TOP to avoid reusing an old task that has other
    // activities
    // on top of the one we want. We don't want to do this in in-app search
    // though,
    // as it can be destructive to the activity stack.
    if (data != null) {
        intent.setData(data);
    }
    intent.putExtra(SearchManager.USER_QUERY, mUserQuery);
    if (query != null) {
        intent.putExtra(SearchManager.QUERY, query);
    }
    if (extraData != null) {
        intent.putExtra(SearchManager.EXTRA_DATA_KEY, extraData);
    }
    if (mAppSearchData != null) {
        intent.putExtra(SearchManager.APP_DATA, mAppSearchData);
    }
    if (actionKey != KeyEvent.KEYCODE_UNKNOWN) {
        intent.putExtra(SearchManager.ACTION_KEY, actionKey);
        intent.putExtra(SearchManager.ACTION_MSG, actionMsg);
    }
    if (IS_AT_LEAST_FROYO) {
        intent.setComponent(mSearchable.getSearchActivity());
    }
    return intent;
}

From source file:com.tandong.sa.sherlock.widget.SearchView.java

/**
 * Constructs an intent from the given information and the search dialog
 * state.// ww w.  j  a  v  a  2  s  .  c  o  m
 * 
 * @param action
 *            Intent action.
 * @param data
 *            Intent data, or <code>null</code>.
 * @param extraData
 *            Data for {@link SearchManager#EXTRA_DATA_KEY} or
 *            <code>null</code>.
 * @param query
 *            Intent query, or <code>null</code>.
 * @param actionKey
 *            The key code of the action key that was pressed, or
 *            {@link KeyEvent#KEYCODE_UNKNOWN} if none.
 * @param actionMsg
 *            The message for the action key that was pressed, or
 *            <code>null</code> if none.
 * @return The intent.
 */
private Intent createIntent(String action, Uri data, String extraData, String query, int actionKey,
        String actionMsg) {
    // Now build the Intent
    Intent intent = new Intent(action);
    intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    // We need CLEAR_TOP to avoid reusing an old task that has other
    // activities
    // on top of the one we want. We don't want to do this in in-app search
    // though,
    // as it can be destructive to the activity stack.
    if (data != null) {
        intent.setData(data);
    }
    intent.putExtra(SearchManager.USER_QUERY, mUserQuery);
    if (query != null) {
        intent.putExtra(SearchManager.QUERY, query);
    }
    if (extraData != null) {
        intent.putExtra(SearchManager.EXTRA_DATA_KEY, extraData);
    }
    if (mAppSearchData != null) {
        intent.putExtra(SearchManager.APP_DATA, mAppSearchData);
    }
    if (actionKey != KeyEvent.KEYCODE_UNKNOWN) {
        intent.putExtra(SearchManager.ACTION_KEY, actionKey);
        intent.putExtra(SearchManager.ACTION_MSG, actionMsg);
    }
    intent.setComponent(mSearchable.getSearchActivity());
    return intent;
}