overridefunonProvideAssistContent(outContent:AssistContent){super.onProvideAssistContent(outContent)// JSON-LD object based on Schema.org structured dataoutContent.structuredData=JSONObject().put("@type","ItemList").put("name","My Work items").put("url","https://my-notes-and-lists.com/lists/12345a").toString()}
Java
@OverridepublicvoidonProvideAssistContent(AssistContentoutContent){super.onProvideAssistContent(outContent);// JSON-LD object based on Schema.org structured dataoutContent.structuredData=newJSONObject().put("@type","ItemList").put("name","My Work items").put("url","https://my-notes-and-lists.com/lists/12345a").toString();}
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["缺少我需要的資訊","missingTheInformationINeed","thumb-down"],["過於複雜/步驟過多","tooComplicatedTooManySteps","thumb-down"],["過時","outOfDate","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["示例/程式碼問題","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-08-08 (世界標準時間)。"],[],[],null,["# Assistant sharing\n\nUsers on Android phones can ask Google Assistant to share app content with\nanother user using a voice command like *\"Hey Google, send this to Jane.\"* Based\non the first user's system options, Assistant can then incorporate text from\nthe screen or a device screenshot in the shared content.\n**Figure 1.** Assistant shares a photo with a contact.\n\nThis method of sharing is often sufficient, but users who receive content shared\nfrom your app might not re-enter the app to view content. You can provide\nAssistant with structured information about the current foreground content by\nimplementing the [`onProvideAssistContent()`](/reference/android/app/Activity#onProvideAssistContent(android.app.assist.AssistContent)) method.\n\nThis process helps maintain the structure of data as it's shared to another\nuser. Users who receive shared app content can then be deep linked or receive\ncontent directly, instead of as text or as a screenshot.\n\nImplement `onProvideAssistContent()` for any sharable\n[`entity`](/guide/app-actions/legacy/action-schema#entity) in your app.\n\nProvide content to Assistant\n----------------------------\n\nYou only need to implement `onProvideAssistContent()` for the final app activity\nin the user's task flow after invoking the App Action. For example, in a\n`GET_ITEM_LIST` flow, implement the method in the final screen\nshowing the item list; you don't need to implement it for any in-progress or\npreview screens.\n\nProvide contextual information as a [JSON-LD](//json-ld.org/) object\n[using schema.org vocabulary](https://schema.org/docs/documents.html) in the\n`structuredData` field of [`AssistContent`](/reference/android/app/assist/AssistContent). The following code snippet shows\nan example of logging contextual content:\nKotlin \n\n```kotlin\noverride fun onProvideAssistContent(outContent: AssistContent) {\n super.onProvideAssistContent(outContent)\n\n // JSON-LD object based on Schema.org structured data\n outContent.structuredData = JSONObject()\n .put(\"@type\", \"ItemList\")\n .put(\"name\", \"My Work items\")\n .put(\"url\", \"https://my-notes-and-lists.com/lists/12345a\")\n .toString()\n}\n \n```\nJava \n\n```java\n@Override\npublic void onProvideAssistContent(AssistContent outContent) {\n super.onProvideAssistContent(outContent);\n\n // JSON-LD object based on Schema.org structured data\n outContent.structuredData = new JSONObject()\n .put(\"@type\", \"ItemList\")\n .put(\"name\", \"My Work items\")\n .put(\"url\", \"https://my-notes-and-lists.com/lists/12345a\")\n .toString();\n}\n \n```\n\nProvide as much data as possible about each `entity`. The\nfollowing fields are required:\n\n- `@type`\n- `.name`\n- `.url` (only required if the content is URL-addressable)\n\nTo learn more about using `onProvideAssistContent()`, see the\n[Optimizing Contextual Content for the Assistant](/training/articles/assistant) guide."]]