0

I'm trying to navigate my app via clicking notification button. Once i click the button on the notification it should navigate to the MainActivity at first and then it should navigate to DeepLinkActivity. But let's say that my current activity is MainActivity and i click the notification button, it opens a new MainActivity on the current one, that means it duplicates. How can i fix it? I don't want to create a new main activity if the current one is already main.

Thank you for your help guys.

val intent = Intent(context, cls)
        intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP or Intent.FLAG_ACTIVITY_CLEAR_TASK or Intent.FLAG_ACTIVITY_NEW_TASK)
        val taskStackBuilder = TaskStackBuilder.create(context)
        taskStackBuilder.addParentStack(cls)
        taskStackBuilder.addNextIntent(intent)
4

0 回答 0