Alex
Alex

Reputation: 23

Android, Kotlin: How to close BottomSheetDialogFragment after activity is closed without using Navigation Components?

Background: In my application, I have a Fragment (A) which contains a list of Accounts. When any Account is clicked, a BottomSheetDialogFragment (B) opens, where you can see a list of options. If Edit option clicked, a new Activity (C) opens.

A

V

C

My issues is: when the last Activity (C) is closed, I'm navigated back to the BottomSheetDialogFragment (B) instead of Fragment (A). How can I go from (C) to (A), when (C) is closed, without using Navigation Component?

Upvotes: 0

Views: 774

Answers (1)

francas
francas

Reputation: 331

When edit option is clicked you can call dismiss method of BottomSheetDialogFragment to finish the dialog.

Upvotes: 1

Related Questions