In this tutorial, you'll learn how to use Slices, which allow you to embed parts of your app into viewers like the Google Search app and Google Assistant.
Hi Tarek, great tutorial! Was wondering how can we use download images in android slices. Would we use isLoading flag ? But when then should be notify the content is now available for display?
Yes, you have to set isLoading to true in the builder of the delayed content, which is the CellBuilder in the example here. addImage(null, ListBuilder.SMALL_IMAGE, true) and once your image is downloaded,
call getContentResolver().notifyChange(sliceUri) using your Slice URI. and that will invoke onBindSlice()
BTW, we used notifyChange(sliceUri) in the tutorial to update the notification icon.
Note, some of the content like title and subtitle is annotated as a NonNull object so you need to set a placeholder at least.