mirror of
https://github.com/bitwarden/mobile.git
synced 2025-01-07 18:58:35 +01:00
Added specific try catch in Android launchApp to avoid the app crashing when trying to launch app package name that are not installed on the device. (#3092)
This commit is contained in:
parent
64775694e0
commit
f04ff7777a
@ -71,6 +71,8 @@ namespace Bit.Droid.Services
|
||||
}
|
||||
|
||||
public bool LaunchApp(string appName)
|
||||
{
|
||||
try
|
||||
{
|
||||
if ((int)Build.VERSION.SdkInt < 33)
|
||||
{
|
||||
@ -84,6 +86,15 @@ namespace Bit.Droid.Services
|
||||
launchIntentSender?.SendIntent(activity, Result.Ok, null, null, null);
|
||||
return launchIntentSender != null;
|
||||
}
|
||||
catch (IntentSender.SendIntentException)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
catch (Android.Util.AndroidException)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public async Task ShowLoadingAsync(string text)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user