TrianguloY / URLCheck

Android app by TrianguloY: URLCheck
Other
998 stars 57 forks source link

Auto close the application after opening or sharing the link #238

Closed advait404 closed 8 months ago

advait404 commented 1 year ago

Hi, I think the new update caused a bug. Previously, clicking on a URL to open urlchecker, and clicking a browser would result in the link opening, and the urlchecker app would close.

Now, the app remains running in the background, and can be visible in the running apps section.

I saw this happening with the fairemail app only for now, when we try to open a link from an email. In other apps it seems to work fine.

douchesfeedboard commented 1 year ago

I noticed the same issue than you with discord. Since the last update, after opening a link, when switching back from the browser to the previous app, it goes to the urlchecker app instead of discord. Urlchecker is indeed visible into the running apps list after opening a link. It doesn't happen with 2.10 so I did a rollback. Urlchecker correctly close itself after opening links with this one.

"close after opening" setting is on into the "open & share" module.

TrianguloY commented 1 year ago

2.11 did indeed changed the app properties. Previously it was configured to not appear in the recents screen, but that meant that when opening the next app, that one didn't appear either, and that was a problem. I removed that, and tried to make sure that the app was properly closed to avoid appearing, but it seems on some cases it isn't. On my device it sometimes happens, but then I manually remove the app from recents and doesn't appear again.

I'm not sure what the correct configuration is here. If I make the app "invisible", opened apps will be too. If I don't, the app will appear sometimes.

If someone has better understanding on how android activities work, and how to make this an "invisible passthrough" please help!

pressRtowin commented 1 year ago

Isn't there a flag specifically for this? Forcing the use of the flag when launching the activity from URLCheck should resolve this.

Edit: Was URLCheck being launched with FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS to keep it out of the recents page? If so, shouldn't starting new activities with FLAG_ACTIVITY_NEW_TASK resolve the issue?

pressRtowin commented 1 year ago

I think this is relevant too: https://developer.android.com/guide/components/activities/tasks-and-back-stack

TrianguloY commented 1 year ago

Was URLCheck being launched with FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS to keep it out of the recents page? If so, shouldn't starting new activities with FLAG_ACTIVITY_NEW_TASK resolve the issue?

Exactly. Originally the activity was configured with that, and since the app reuses the intent, it was also used when launching next browsers. And yes, clearing it would solve the issue, but will include another one: what if an app wanted to include that flag? We would be removing it!

If we want to launch intents as closest as the original (as if the app wasn't there) we need to not specify any flag.

I searched and apparently there is a way to set that flag programmatically, so that should be the best solution.

nihal697 commented 1 year ago

Hi, I was going to create an issue but saw that there is already a discussion related to my issue. Im attaching a screen record to show that it happens with all the apps. Enablimg the flags ACTIVITY EXCLUDE FROM RECENTS does not affect either.

https://github.com/TrianguloY/UrlChecker/assets/47318989/b6944788-5942-43dd-a2d6-99c5320f99a6

yephny commented 1 year ago

I have this issue as well and it depends.

If I hit the Github link in Droid-ify, Urlcheck pops up and I click open with Octodroid. I don't see the app in recents after this (though Octodroid launches inside Droid-ify, like I don't see a separate Droid-ify instance in recents, and I can simply "go back" to Droid-ify).

In Blue Line Console, I search for something and hit Return, which launches Urlcheck. When I select my browser of choice, Urlcheck still appears in Recents.

All the apps mentioned are on F-Droid.

AeliusSaionji commented 1 year ago

I'm also affected by this.

I never noticed the prior problem (following app not in recents). But when I use ths swipe back gesture and land on URLChecker, that I notice.

Every single time I click a link.

The previous way was the lesser of two evils.

TrianguloY commented 1 year ago

The new beta version available now on the Play Store has a workaround (a very basic one, not sure if it will work in all circumstances, but it does on the basic ones tested on my device).

If someone can test and report if it works, it would help a lot.

nihal697 commented 1 year ago

The new beta version available now on the Play Store has a workaround (a very basic one, not sure if it will work in all circumstances, but it does on the basic ones tested on my device).

If someone can test and report if it works, it would help a lot.

Hi, I tested the beta build but it still has the issue if the link is opened through telegram, but is fine if link is opened through whatsapp. pfa Screenshot_20231008-230110_Chrome Screenshot_20231008-230304_Chrome

nihal697 commented 1 year ago

The new beta version available now on the Play Store has a workaround (a very basic one, not sure if it will work in all circumstances, but it does on the basic ones tested on my device). If someone can test and report if it works, it would help a lot.

Hi, I tested the beta build but it still has the issue if the link is opened through telegram, but is fine if link is opened through whatsapp. pfa Screenshot_20231008-230110_Chrome Screenshot_20231008-230304_Chrome

It seems to be fine now, there was another update just now on playstore & after updating it's fine on both telegram and whatsapp. kudos to you

TrianguloY commented 1 year ago

Happy to hear that, and thanks for checking!

I'm not going to close the issue yet, I don't quite like the fix, but hopefully it will be good enough for now.

nihal697 commented 1 year ago

Happy to hear that, and thanks for checking!

I'm not going to close the issue yet, I don't quite like the fix, but hopefully it will be good enough for now.

understandable. Just to update, In the past two days I have not yet seen an instance where it's not working so yes the new fix is definitely at least usable.

TrianguloY commented 1 year ago

Turns out this change made the sharing button stop working.

Ouch

I'll try to publish a workaround today or tomorrow.

TrianguloY commented 8 months ago

I think the changes I made last version should fix this.

In going to close it as completed, but if you still see the bug please say so and/or reopen it.