1. Download our Official Android App: Forums for Android!

Where is the background image column in SearchManager?

Discussion in 'TV & Video' started by bansteen, Apr 27, 2016.

  1. bansteen

    bansteen Lurker
    Thread Starter
    Rank:
    None
    Points:
    5
    Posts:
    1
    Joined:
    Jun 27, 2011

    Jun 27, 2011
    1
    0
    5
    I could not find any column to set background image inside SearchManager class.
    When Google Play app's search result is selected, a background image is displayed but I don't seem to find any public api/column to set it.

    Here is my code for content provider's query method
    Code (Java):
    1. @Nullable
    2.     @Override
    3.     public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs,
    4.                         String sortOrder) {
    5.         final String searchKey = (selectionArgs == null) ? "" : selectionArgs[0];
    6.         if (!TextUtils.isEmpty(searchKey)) {
    7.             // Get title list from search query
    8.             ArrayList<TitleSimpleInfo> searchedTitleList = searchTitlesWithKeyword(searchKey);
    9.             // return null cursor if no data found
    10.             if (searchedTitleList == null || searchedTitleList.isEmpty()) {
    11.                 return null;
    12.             }
    13.             // prepare cursor
    14.             MatrixCursor matrixCursor = new MatrixCursor(new String[]{
    15.                     SearchManager.SUGGEST_COLUMN_TEXT_1,
    16.                     SearchManager.SUGGEST_COLUMN_TEXT_2,
    17.                     SearchManager.SUGGEST_COLUMN_CONTENT_TYPE,
    18. //                    SearchManager.SUGGEST_COLUMN_PRODUCTION_YEAR,
    19.                     SearchManager.SUGGEST_COLUMN_INTENT_ACTION,
    20.                     SearchManager.SUGGEST_COLUMN_INTENT_DATA,
    21.                     SearchManager.SUGGEST_COLUMN_RESULT_CARD_IMAGE,
    22.             });
    23.             // add search result to cursor
    24.             for (TitleSimpleInfo title : searchedTitleList) {
    25.                 matrixCursor.addRow(new Object[]{
    26.                         title.getTitleName(),
    27.                         title.getTitleCatch(),
    28.                         SEARCH_CONTENT_TYPE,
    29. //                        title.getReleaseYear(),
    30.                         Intent.ACTION_SEARCH,
    31.                         SEARCH_INTENT_DATA + title.getTitleCode(),
    32.                         SEARCH_IMAGE_HEADER + title.getThumbnailUrl(),
    33.                 });
    34.             }
    35.             return matrixCursor;
    36.         } else {
    37.             return null;
    38.         }
    39.     }
    Any idea guys?

    Device: Nexus player
     

    Advertisement

Share This Page

Loading...