Hello,
I've tested your sample, and found a workaround. You could try the following steps:
Step1. Create a new Activity class file, such as ShareActivity.cs
in the Platforms/Android/
folder.
Step2. Copy your ShareActivity
class into this ShareActivity.cs
, then, please add the following code for your Activity:
[Activity(Theme = "@style/Maui.SplashTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize | ConfigChanges.Density, ScreenOrientation = ScreenOrientation.Portrait)]
[IntentFilter(new[] { Intent.ActionSend }, Categories = new[] { Intent.CategoryDefault }, DataMimeType = "text/plain")]
public class ShareActivity : MauiAppCompatActivity
Note: The Intent object is in the Android.Content
namespace.
After that, you could see the AlertDialog
to input your url link.
Best Regards,
Alec Liu.
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.