sharee.bike-App/ShareeBike/ShareeBike.Android/Model/Device/ExternalBrowseService.cs
2024-04-09 12:53:23 +02:00

23 lines
No EOL
633 B
C#

using Android.Content;
using ShareeBike.Droid.Model.Device;
using ShareeBike.Model.Device;
using Xamarin.Forms;
[assembly: Dependency(typeof(ExternalBrowseService))]
namespace ShareeBike.Droid.Model.Device
{
public class ExternalBrowseService : IExternalBrowserService
{
/// <summary> Opens an external browser. </summary>
/// <param name="p_strUrl">Url to open.</param>
public void OpenUrl(string p_strUrl)
{
var uri = Android.Net.Uri.Parse(p_strUrl);
var intent = new Intent(Intent.ActionView, uri);
intent.AddFlags(ActivityFlags.NewTask);
Android.App.Application.Context.StartActivity(intent);
}
}
}