Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reopen the app when clicking the whole notification #1221

Merged
merged 1 commit into from
Aug 20, 2018

Conversation

Guardiola31337
Copy link
Contributor

  • Adds pendingOpenIntent which brings the existing task (Activity) to the foreground when clicking the notification

Fixes #713

cc @devotaaabel

…the foreground when clicking the notification
@Guardiola31337 Guardiola31337 added feature New feature request. navigation-core labels Aug 17, 2018
@Guardiola31337 Guardiola31337 added this to the 0.18.0 milestone Aug 17, 2018
@Guardiola31337 Guardiola31337 self-assigned this Aug 17, 2018
Copy link
Contributor

@danesfeder danesfeder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for digging on this @Guardiola31337 and @devotaaabel - glad to see the solution was relatively simple.

@Guardiola31337
Copy link
Contributor Author

glad to see the solution was relatively simple.

And hacky 😂

It only works using 👇 combination of methods 😬

private PendingIntent createPendingOpenIntent(Context context) {
PackageManager pm = context.getPackageManager();
Intent intent = pm.getLaunchIntentForPackage(context.getPackageName());
intent.setPackage(null);
return PendingIntent.getActivity(context, 0, intent, 0);
}

@Guardiola31337 Guardiola31337 merged commit 8d36aa2 into master Aug 20, 2018
@Guardiola31337 Guardiola31337 deleted the pg-open-activity-notification branch August 20, 2018 07:30
@Guardiola31337 Guardiola31337 mentioned this pull request Aug 24, 2018
11 tasks
@Guardiola31337 Guardiola31337 changed the title Reopen the app when when clicking the whole notification Reopen the app when clicking the whole notification Oct 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature request.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants