歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux編程 >> Linux編程 >> Android提供語音搜索功能

Android提供語音搜索功能

日期:2017/3/1 11:08:06   编辑:Linux編程

只需要在searchable配置文件中寫入下面的代碼,很簡單:

<?xml version="1.0" encoding="utf-8"?>
<searchable xmlns:Android="http://schemas.android.com/apk/res/android"
android:label="@string/search_label"
android:hint="@string/search_hint"
android:voiceSearchMode="showVoiceSearchButton|launchRecognizer" >
</searchable>

注意:

一定要認真考慮是否語音搜索是否適合你的應用程序。要充分的測試你的語言識別,確保能夠識別你的查詢類型!切記,切記!

Copyright © Linux教程網 All Rights Reserved