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

I did my own fork to fix moveToBackground on Android #576

Open
alindzon opened this issue Dec 8, 2022 · 1 comment
Open

I did my own fork to fix moveToBackground on Android #576

alindzon opened this issue Dec 8, 2022 · 1 comment

Comments

@alindzon
Copy link

alindzon commented Dec 8, 2022

The way it is written it goes to the home screen. I wanted to go back to whatever the previous foreground app was. Took hours but I found it. I recommend whomever is maintaining this plugin to adopt this code instead.

private void moveToBackground() { Activity app = getApp(); app.moveTaskToBack(true); }

@alindzon
Copy link
Author

alindzon commented Dec 13, 2022

I also had to fix a bug in recent Android releases. for pendingintents you need to have a FLAG_MUTABLE or the opposite. So I had to edit ForeGroundService.java adding | PendingIntet.FLAG_MUTABLE as shown below on line 225.

if (intent != null && settings.optBoolean("resume")) { intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); PendingIntent contentIntent = PendingIntent.getActivity( context, NOTIFICATION_ID, intent, PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_MUTABLE);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant