Click here to Skip to main content
15,886,919 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

my app is sending notifications to the user, which should open a certain page in the app when tapped.
Passing parameters works fine, opening the page, too.
But one problem drives me mad: every time when the app is called from the notification-intent, a new activity-instance is created and the "old" one continues to exist. But I'd like to reuse the main activity.

Does anybody know how to archive reusing the main activiy when calling the app via intent from a notification?

Regards

What I have tried:

protected override void OnNewIntent(Intent intent)
        {
        var intent = new Intent(this, typeof(MainActivity)).SetFlags(ActivityFlags.ReorderToFront);
StartActivity(intent);
        }
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900