Permalink
Browse files

Add ISocial Android implementation.

  • Loading branch information...
ilanolkies committed Jun 6, 2018
1 parent edd998b commit b9f2f51f5db4793a3c1d28238c2c251c78d13bfc
Showing with 21 additions and 0 deletions.
  1. +20 −0 XamarinSocial.Android/SocialService.cs
  2. +1 −0 XamarinSocial.Android/XamarinSocial.Android.csproj
@@ -0,0 +1,20 @@
using Android.Content;
using Xamarin.Forms;
using XamarinSocial.Droid;

[assembly: Dependency(typeof(SocialService))]
namespace XamarinSocial.Droid
{
public class SocialService : ISocial
{
public void Share(string content)
{
Intent share = new Intent(Intent.ActionSend)
.SetType("text/plain")
.AddFlags(ActivityFlags.ClearWhenTaskReset)
.PutExtra(Intent.ExtraText, content);

Android.App.Application.Context.StartActivity(Intent.CreateChooser(share, "Compartir!"));
}
}
}
@@ -61,6 +61,7 @@
<Compile Include="MainActivity.cs" />
<Compile Include="Resources\Resource.Designer.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="SocialService.cs" />
</ItemGroup>
<ItemGroup>
<None Include="Properties\AndroidManifest.xml" />

0 comments on commit b9f2f51

Please sign in to comment.