0

I have a Splash_Screen fragment. After navigating to the next fragment, I want my SplashScreen fragment to be destroyed. How can I do this? I use getActivity().finish and this finishes my app.

Ryan M
  • 18,333
  • 31
  • 67
  • 74
  • Does this answer your question? [How to close the current fragment by using Button like the back button?](https://stackoverflow.com/questions/20812922/how-to-close-the-current-fragment-by-using-button-like-the-back-button) – Keivan.k Aug 16 '20 at 07:36

1 Answers1

0

Once you move from Splash_Screen Fragment to next fragment,Remove Your Splash_Screen Fragment form 'BACKSTACK'. So Your Splash_Screen Fragment will not open again. How this works for you.

For more information see below thread from Stack Over Flow:

How to clear Fragment backstack in android

SaiAbhijit
  • 386
  • 4
  • 6
  • tanks for answer i use navigation component and i dont no how to use Backstack on navigation component – ali3529 Aug 15 '20 at 11:42