當前位置: 首頁>>代碼示例>>Java>>正文


Java SearchableInfo.getVoiceSearchLaunchRecognizer方法代碼示例

本文整理匯總了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");
    }
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:23,代碼來源:SearchView.java

示例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");
    }
}
 
開發者ID:GigigoGreenLabs,項目名稱:permissionsModule,代碼行數:24,代碼來源:SearchView.java

示例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");
        }
    }
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:16,代碼來源:SearchView.java

示例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);
}
 
開發者ID:ChiangC,項目名稱:FMTech,代碼行數:28,代碼來源:SearchView.java


注:本文中的android.app.SearchableInfo.getVoiceSearchLaunchRecognizer方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。