संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
कुछ मामलों में, हो सकता है कि आप व्यू देने के लिए एक्सएमएल और RemoteViews का इस्तेमाल करना चाहें.
यह मुमकिन है कि आपने किसी सुविधा को, एक नज़र में जानकारी देखने की सुविधा के बिना ही चालू कर दिया हो या सुविधा
फ़िलहाल, एक नज़र में जानकारी देखने के लिए इस्तेमाल किए जा रहे एपीआई के साथ उपलब्ध नहीं है या मुमकिन नहीं है. ऐसे मामलों में,
एक नज़र में जानकारी देखने की सुविधा, AndroidRemoteViews की सुविधा देती है. यह इंटरऑपरेबिलिटी एपीआई है.
AndroidRemoteViews कंपोज़ेबल में RemoteViews को एक साथ रखा जा सकता है
अपने अन्य कंपोज़ेबल के साथ:
valpackageName=LocalContext.current.packageNameColumn(modifier=GlanceModifier.fillMaxSize()){Text("Isn't that cool?")AndroidRemoteViews(RemoteViews(packageName,R.layout.example_layout))}
RemoteViews को वैसे ही बनाएं और तय करें जैसा आपको एक नज़र में देखने की सुविधा के बिना करना है. इसके बाद,
इसे एक पैरामीटर के तौर पर लिख सकते हैं.
इसके अलावा, अपने कंपोज़ेबल के लिए RemoteViews कंटेनर भी बनाए जा सकते हैं:
AndroidRemoteViews(remoteViews=RemoteViews(packageName,R.layout.my_container_view),containerViewId=R.id.example_view){Column(modifier=GlanceModifier.fillMaxSize()){Text("My title")Text("Maybe a long content...")}}
इस मामले में, "कंटेनर" वाला लेआउट तय की गई वैल्यू के साथ पास किया जाता है
आईडी. यह कंटेनर ViewGroup होना चाहिए, क्योंकि इसका इस्तेमाल
तय किया गया कॉन्टेंट.
इस पेज पर मौजूद कॉन्टेंट और कोड सैंपल कॉन्टेंट के लाइसेंस में बताए गए लाइसेंस के हिसाब से हैं. Java और OpenJDK, Oracle और/या इससे जुड़ी हुई कंपनियों के ट्रेडमार्क या रजिस्टर किए हुए ट्रेडमार्क हैं.
आखिरी बार 2025-08-28 (UTC) को अपडेट किया गया.
[[["समझने में आसान है","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-28 (UTC) को अपडेट किया गया."],[],[],null,["In some cases, you may want to use XML and `RemoteViews` to provide a view.\nPerhaps you have already implemented a feature without Glance, or the feature is\nnot yet available or possible with the current Glance API. For these situations,\nGlance provides `AndroidRemoteViews`, an interoperability API.\n\nThe `AndroidRemoteViews` composable allows `RemoteViews` to be placed together\nwith your other composables:\n\n\n```kotlin\nval packageName = LocalContext.current.packageName\nColumn(modifier = GlanceModifier.fillMaxSize()) {\n Text(\"Isn't that cool?\")\n AndroidRemoteViews(RemoteViews(packageName, R.layout.example_layout))\n}https://github.com/android/snippets/blob/dd30aee903e8c247786c064faab1a9ca8d10b46e/compose/snippets/src/main/java/com/example/compose/snippets/glance/GlanceSnippets.kt#L903-L907\n```\n\n\u003cbr /\u003e\n\nCreate and define the `RemoteViews` as you would without Glance, and simply pass\nit as a parameter.\n\nIn addition, you can create `RemoteViews` containers for your composables:\n\n\n```kotlin\nAndroidRemoteViews(\n remoteViews = RemoteViews(packageName, R.layout.my_container_view),\n containerViewId = R.id.example_view\n) {\n Column(modifier = GlanceModifier.fillMaxSize()) {\n Text(\"My title\")\n Text(\"Maybe a long content...\")\n }\n}https://github.com/android/snippets/blob/dd30aee903e8c247786c064faab1a9ca8d10b46e/compose/snippets/src/main/java/com/example/compose/snippets/glance/GlanceSnippets.kt#L916-L925\n```\n\n\u003cbr /\u003e\n\nIn this case, a layout that contains the \"container\" is passed with the defined\nID. This container must be a [`ViewGroup`](/reference/android/view/ViewGroup), since it is used to place the\ndefined content.\n| **Note:** Any children of the defined container are removed and replaced with the content. Also, the provided `ViewGroup` must be supported by `RemoteViews.` See [`RemoteViewsWidget.kt`](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:glance/glance-appwidget/integration-tests/demos/src/main/java/androidx/glance/appwidget/demos/RemoteViewsWidget.kt) for an example of using `AndroidRemoteViews`."]]