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


Java SearchManager.SHORTCUT_MIME_TYPE屬性代碼示例

本文整理匯總了Java中android.app.SearchManager.SHORTCUT_MIME_TYPE屬性的典型用法代碼示例。如果您正苦於以下問題:Java SearchManager.SHORTCUT_MIME_TYPE屬性的具體用法?Java SearchManager.SHORTCUT_MIME_TYPE怎麽用?Java SearchManager.SHORTCUT_MIME_TYPE使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在android.app.SearchManager的用法示例。


在下文中一共展示了SearchManager.SHORTCUT_MIME_TYPE屬性的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getType

@Override
public String getType(@NonNull Uri uri) {
    switch (sUriMatcher.match(uri)) {
        // The application is querying the db for its own contents.
        case VIDEO_WITH_CATEGORY:
            return VideoContract.VideoEntry.CONTENT_TYPE;
        case VIDEO:
            return VideoContract.VideoEntry.CONTENT_TYPE;

        // The Android TV global search is querying our app for relevant content.
        case SEARCH_SUGGEST:
            return SearchManager.SUGGEST_MIME_TYPE;
        case REFRESH_SHORTCUT:
            return SearchManager.SHORTCUT_MIME_TYPE;

        // We aren't sure what is being asked of us.
        default:
            throw new UnsupportedOperationException("Unknown uri: " + uri);
    }
}
 
開發者ID:nejtv,項目名稱:androidtv-sample,代碼行數:20,代碼來源:VideoProvider.java

示例2: getType

/**
 * This method is required in order to query the supported types.
 * It's also useful in our own query() method to determine the type of Uri received.
 */
@Override
public String getType(Uri uri) {
    switch (sURIMatcher.match(uri)) {
        case SEARCH_WORDS:
            return WORDS_MIME_TYPE;
        case GET_WORD:
            return DEFINITION_MIME_TYPE;
        case SEARCH_SUGGEST:
            return SearchManager.SUGGEST_MIME_TYPE;
        case REFRESH_SHORTCUT:
            return SearchManager.SHORTCUT_MIME_TYPE;
        default:
            throw new IllegalArgumentException("Unknown URL " + uri);
    }
}
 
開發者ID:sdrausty,項目名稱:buildAPKsSamples,代碼行數:19,代碼來源:DictionaryProvider.java


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