sharee.bike-App/LastenradBayern/TINK.Android/Model/Device/ExternalBrowseService.cs

23 lines
615 B
C#
Raw Normal View History

2022-08-30 15:42:25 +02:00
using Android.Content;
2021-11-07 19:42:59 +01:00
using TINK.Droid.Model.Device;
2022-08-30 15:42:25 +02:00
using TINK.Model.Device;
2021-11-07 19:42:59 +01:00
using Xamarin.Forms;
[assembly: Dependency(typeof(ExternalBrowseService))]
namespace TINK.Droid.Model.Device
{
2022-09-06 16:08:19 +02:00
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);
2021-11-07 19:42:59 +01:00
2022-09-06 16:08:19 +02:00
intent.AddFlags(ActivityFlags.NewTask);
2021-11-07 19:42:59 +01:00
2022-09-06 16:08:19 +02:00
Android.App.Application.Context.StartActivity(intent);
}
}
2021-11-07 19:42:59 +01:00
}