Note that there are some explanatory texts on larger screens.

plurals
  1. POUsing SearchManager's SUGGEST_COLUMN_ICON_1 to display a local file
    primarykey
    data
    text
    <p>I'm implementing my own <code>SearchRecentSuggestionsProvider</code> and everything's working except one thing: I can't get the device search to display icons for the results. I'd like to display images from my application's data folder (located at <code>/{sdcard}/Android/data/package_name/files/</code>)</p> <p>According to <a href="http://developer.android.com/reference/android/app/SearchManager.html#SUGGEST_COLUMN_ICON_1" rel="nofollow">the documentation</a>, it's achievable by using <code>SearchManager.SUGGEST_COLUMN_ICON_1</code>, and it apparently supports a number of schemes, including <code>ContentResolver.SCHEME_FILE</code>, which is <code>file</code>. Here's a quote from the official docs:</p> <blockquote> <p>Column name for suggestions cursor. <em>Optional.</em> If your cursor includes this column, then all suggestions will be provided in a format that includes space for two small icons, one at the left and one at the right of each suggestion. The data in the column must be a resource ID of a drawable, or a URI in one of the following formats:</p> <p>content (<code>SCHEME_CONTENT</code>)</p> <p>android.resource (<code>SCHEME_ANDROID_RESOURCE</code>)</p> <p>file (<code>SCHEME_FILE</code>)</p> </blockquote> <p>I've tried a number of obvious things, including manual creation of the file URI and automated creation using <code>Uri.Builder()</code>. None of this worked.</p> <p>I also found someone else asking about the same thing on Google Groups, and it's sadly unanswered: <a href="https://groups.google.com/forum/#!topic/android-developers/MJj7GIaONjc" rel="nofollow">https://groups.google.com/forum/#!topic/android-developers/MJj7GIaONjc</a></p> <p>Does anyone have any experience in getting the device search to display local images from the device?</p> <p><strong>UPDATE (December 15):</strong> I've just tried using the <code>ContentProvider</code> with a <code>SearchView</code> as the searchable info, and it works exactly as expected - including the cover art images. Still, global search doesn't show it...</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload