Exodus-Privacy / exodus-android-app

εxodus Android application

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Implement methods in Utils to open link and ignore ActivityNotFoundException

Jean-BaptisteC opened this issue · comments

Actually in app, we open link without ignore crash ActivityNotFoundException.
I have added fix here a4755cc to ignore ActivityNotFoundException and don't generate crash when devices have not mail app or store app

I suggest to create 2 methods in utils:

Hello Jean, I am looking for my first good contribution. So, it will great, if I can contribute to this issue.
I am thinking of solving the issue by this approach.
These are the two methods I created as mentioned in the original issue.
Please let me know, in which file should I put these methods?

fun customTabIntentWithoutException(view: View, string: String) {
	try {
		customTabsIntent.launchUrl(
			view.context,
			Uri.parse(string)
		)
	} catch (e: ActivityNotFoundException) {
	}
}

fun startActivityWithoutException(intent: Intent) {
	try {
		startActivity(intent)
	} catch (e: ActivityNotFoundException) {
	}
}

Waiting for your feedback. Thank you.

Code looks good, you can add methods in CommonExtensions.kt
Please wait, i want push PR #276 before because, i have doing somes changes about this

PR is merge, you can push your changes

Be careful here

if users doesn't have app store, i start browser
Same here with settings