您的位置:首页 > 运维架构 > 网站架构

搜索框没有语音架构的时候

2015-11-02 17:34 190 查看
- if (shouldShowVoiceSearch(queryEmpty)

- && getVoiceSearch().shouldShowVoiceSearch()) {

+ if (isVoiceShow() && shouldShowVoiceSearch(queryEmpty)

+ && getVoiceSearch().shouldShowVoiceSearch

+ ()) {

mVoiceSearchButton.setVisibility(View.VISIBLE);

mQueryTextView.setPrivateImeOptions(IME_OPTION_NO_MICROPHONE);

} else {

@@ -285,6 +298,16 @@ public abstract class SearchActivityView extends RelativeLayout {

}

}

+ public boolean isVoiceShow() {

+ PackageManager packageManager = getContext().getPackageManager();

+ List<ResolveInfo> activities = packageManager.queryIntentActivities(new Intent(

+ RecognizerIntent.ACTION_WEB_SEARCH), 0);

+ if (activities.size() != 0) return true;

+ return false;

+ }
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: