本文整理匯總了Java中android.app.SearchableInfo.getVoiceSearchLaunchRecognizer方法的典型用法代碼示例。如果您正苦於以下問題:Java SearchableInfo.getVoiceSearchLaunchRecognizer方法的具體用法?Java SearchableInfo.getVoiceSearchLaunchRecognizer怎麽用?Java SearchableInfo.getVoiceSearchLaunchRecognizer使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類android.app.SearchableInfo
的用法示例。
在下文中一共展示了SearchableInfo.getVoiceSearchLaunchRecognizer方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: onVoiceClicked
import android.app.SearchableInfo; //導入方法依賴的package包/類
private void onVoiceClicked() {
// guard against possible race conditions
if (mSearchable == null) {
return;
}
SearchableInfo searchable = mSearchable;
try {
if (searchable.getVoiceSearchLaunchWebSearch()) {
Intent webSearchIntent = createVoiceWebSearchIntent(mVoiceWebSearchIntent,
searchable);
getContext().startActivity(webSearchIntent);
} else if (searchable.getVoiceSearchLaunchRecognizer()) {
Intent appSearchIntent = createVoiceAppSearchIntent(mVoiceAppSearchIntent,
searchable);
getContext().startActivity(appSearchIntent);
}
} catch (ActivityNotFoundException e) {
// Should not happen, since we check the availability of
// voice search before showing the button. But just in case...
Log.w(LOG_TAG, "Could not find voice search activity");
}
}
示例2: onVoiceClicked
import android.app.SearchableInfo; //導入方法依賴的package包/類
@TargetApi(Build.VERSION_CODES.FROYO)
private void onVoiceClicked() {
// guard against possible race conditions
if (mSearchable == null) {
return;
}
SearchableInfo searchable = mSearchable;
try {
if (searchable.getVoiceSearchLaunchWebSearch()) {
Intent webSearchIntent = createVoiceWebSearchIntent(mVoiceWebSearchIntent,
searchable);
getContext().startActivity(webSearchIntent);
} else if (searchable.getVoiceSearchLaunchRecognizer()) {
Intent appSearchIntent = createVoiceAppSearchIntent(mVoiceAppSearchIntent,
searchable);
getContext().startActivity(appSearchIntent);
}
} catch (ActivityNotFoundException e) {
// Should not happen, since we check the availability of
// voice search before showing the button. But just in case...
Log.w(LOG_TAG, "Could not find voice search activity");
}
}
示例3: onVoiceClicked
import android.app.SearchableInfo; //導入方法依賴的package包/類
@TargetApi(8)
private void onVoiceClicked() {
if (this.mSearchable != null) {
SearchableInfo searchable = this.mSearchable;
try {
if (searchable.getVoiceSearchLaunchWebSearch()) {
getContext().startActivity(createVoiceWebSearchIntent(this.mVoiceWebSearchIntent, searchable));
} else if (searchable.getVoiceSearchLaunchRecognizer()) {
getContext().startActivity(createVoiceAppSearchIntent(this.mVoiceAppSearchIntent, searchable));
}
} catch (ActivityNotFoundException e) {
Log.w(LOG_TAG, "Could not find voice search activity");
}
}
}
示例4: onVoiceClicked
import android.app.SearchableInfo; //導入方法依賴的package包/類
@TargetApi(8)
private void onVoiceClicked()
{
if (this.mSearchable == null) {}
SearchableInfo localSearchableInfo;
do
{
return;
localSearchableInfo = this.mSearchable;
try
{
if (localSearchableInfo.getVoiceSearchLaunchWebSearch())
{
Intent localIntent2 = createVoiceWebSearchIntent(this.mVoiceWebSearchIntent, localSearchableInfo);
getContext().startActivity(localIntent2);
return;
}
}
catch (ActivityNotFoundException localActivityNotFoundException)
{
Log.w("SearchView", "Could not find voice search activity");
return;
}
} while (!localSearchableInfo.getVoiceSearchLaunchRecognizer());
Intent localIntent1 = createVoiceAppSearchIntent(this.mVoiceAppSearchIntent, localSearchableInfo);
getContext().startActivity(localIntent1);
}