با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
این سند نشان میدهد که چگونه استفاده از مقاصد گفتگو میتواند ملاحظات منحصربهفردی را برای نحوه نیاز به مدیریت پشته پشتی خود معرفی کند.
نمای کلی
یک یا چند مقصد گفتگو فقط می تواند در بالای پشته پشتی وجود داشته باشد. این به این دلیل است که وقتی کاربر به مقصدی میرود که مقصد گفتگو نیست، NavController به طور خودکار تمام مقصدهای گفتگو را از بالای پشته خارج میکند. این تضمین می کند که مقصد فعلی همیشه به طور کامل بر روی سایر مقاصد در پشته قابل مشاهده است.
اگر پشته پشتی صرفاً از مقصدهای میزبانی شده تشکیل شده باشد که میزبان ناوبری را پر می کند و کاربر به یک مقصد محاوره ای هدایت می شود، پس پشته ممکن است شبیه شکل 2 باشد:
شکل 2. پشته پشتی با مقصد گفتگو در بالا.
اگر کاربر سپس به مقصد محاوره ای دیگری هدایت شود، همانطور که در شکل 3 نشان داده شده است، به بالای پشته اضافه می شود:
شکل 3. پشته پشتی با دو مقصد Dialog در بالا.
اگر کاربر سپس به مقصدی غیر شناور حرکت کند، همانطور که در شکل 4 نشان داده شده است، هر مقصد محاوره ای ابتدا از بالای پشته پشتی نمایش داده می شود.
شکل 4. مقصدهای Dialog ظاهر می شوند و مقصد جدید اضافه می شود.
محتوا و نمونه کدها در این صفحه مشمول پروانههای توصیفشده در پروانه محتوا هستند. جاوا و OpenJDK علامتهای تجاری یا علامتهای تجاری ثبتشده Oracle و/یا وابستههای آن هستند.
تاریخ آخرین بهروزرسانی 2025-07-29 بهوقت ساعت هماهنگ جهانی.
[[["درک آسان","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-07-29 بهوقت ساعت هماهنگ جهانی."],[],[],null,["# Dialog destinations\n\nThis document outlines how the use of [dialog destinations](/guide/navigation/design) can introduce\nunique considerations for how you need to manage your back stack.\n\nOverview\n--------\n\nOne or more dialog destinations can only exist on the top of the back stack.\nThis is because when the user navigates to a destination that is not a dialog\ndestination, the `NavController` automatically pops all dialog destinations off\nthe top of the stack. This ensures that the current destination is always fully\nvisible over other destinations on the back stack.\n\nDestinations can be either [hosted destinations](/guide/navigation/design), [activity\ndestinations](/guide/navigation/design/activity-destinations), or [dialog destination](/guide/navigation/design/dialog-destinations).\n| **Note:** Dialog destinations implement the [`FloatingWindow`](/reference/androidx/navigation/FloatingWindow) interface. As such, they overlay other destinations on the back stack.\n\nExample\n-------\n\nIf the back stack consists solely of [hosted destinations](/guide/navigation/design)\nthat fill the navigation host, and the user navigates to a dialog destination,\nthen the back stack might look similar to figure 2:\n**Figure 2.** A back stack with a dialog destination on top.\n\nIf the user then navigates to another dialog destination, it is then added to\nthe top of the back stack, as shown in figure 3:\n**Figure 3.** A back stack with two `Dialog` destinations on top.\n\nIf the user then navigates to a non-floating destination, any dialog\ndestinations are first popped from the top of the back stack before navigating\nto the new destination, as shown in figure 4:\n**Figure 4.** The `Dialog` destinations are popped, and the new destination is added."]]