如何从 return 搜索建议结果的意图中获取 EXTRA_DATA
how to get EXTRA_DATA from intent that return Search Suggestions results
我可以通过以下方式获取此 SearchManager.SUGGEST_COLUMN_INTENT_DATA,
的数据:
intent.getSataString();
我的问题是,我怎样才能得到这方面的数据:
SearchManager.SUGGEST_COLUMN_INTENT_EXTRA_DATA
本题的上下文是这样的:
private final static String[] COLUMN_NAMES = {
BaseColumns._ID,
SearchManager.SUGGEST_COLUMN_TEXT_1,
SearchManager.SUGGEST_COLUMN_TEXT_2,
SearchManager.SUGGEST_COLUMN_QUERY,
SearchManager.SUGGEST_COLUMN_INTENT_DATA,
SearchManager.SUGGEST_COLUMN_INTENT_EXTRA_DATA,
SearchManager.SUGGEST_COLUMN_INTENT_ACTION};
查看 Android 文档,我发现了这个:
public static final String EXTRA_DATA_KEY
Intent extra data key: This key will be used for the extra populated
by the SUGGEST_COLUMN_INTENT_EXTRA_DATA column.
Constant Value: "intent_extra_data_key"
所以,我尝试了这个:
String myVal = intent.getExtras().getString(SearchManager.EXTRA_DATA_KEY)
这非常有效。
我可以通过以下方式获取此 SearchManager.SUGGEST_COLUMN_INTENT_DATA,
的数据:
intent.getSataString();
我的问题是,我怎样才能得到这方面的数据:
SearchManager.SUGGEST_COLUMN_INTENT_EXTRA_DATA
本题的上下文是这样的:
private final static String[] COLUMN_NAMES = {
BaseColumns._ID,
SearchManager.SUGGEST_COLUMN_TEXT_1,
SearchManager.SUGGEST_COLUMN_TEXT_2,
SearchManager.SUGGEST_COLUMN_QUERY,
SearchManager.SUGGEST_COLUMN_INTENT_DATA,
SearchManager.SUGGEST_COLUMN_INTENT_EXTRA_DATA,
SearchManager.SUGGEST_COLUMN_INTENT_ACTION};
查看 Android 文档,我发现了这个:
public static final String EXTRA_DATA_KEY
Intent extra data key: This key will be used for the extra populated by the SUGGEST_COLUMN_INTENT_EXTRA_DATA column.
Constant Value: "intent_extra_data_key"
所以,我尝试了这个:
String myVal = intent.getExtras().getString(SearchManager.EXTRA_DATA_KEY)
这非常有效。