Code: Select all
...
Code: Select all
[Activity(Theme = "@style/Maui.SplashTheme", MainLauncher = true,
LaunchMode = LaunchMode.SingleTask,
NoHistory = true,
Exported = true,
TaskAffinity = "com.mycompany.myapp",
ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation |
ConfigChanges.UiMode | ConfigChanges.ScreenLayout |
ConfigChanges.SmallestScreenSize | ConfigChanges.Density)]
//whatsapp & telegram send binaries as octet-stream
[IntentFilter(new[] { Android.Content.Intent.ActionSend },
Categories = new[] { Android.Content.Intent.CategoryDefault },
DataMimeType = @"application/octet-stream",
Icon = "@mipmap/appicon")]
public partial class MainActivity : MauiAppCompatActivity
{
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
if (Intent.Action == Intent.ActionSend || Intent.Action == Intent.ActionView)
HandleSendOrViewIntent();
}
//This method is NEVER called
protected override void OnNewIntent(Intent intent)
{
base.OnNewIntent(intent);
if (Intent.Action == Intent.ActionSend || Intent.Action == Intent.ActionView)
HandleSendOrViewIntent(true);
}
}