Intent intent = new Intent(context, typeof(MyActivity)); intent.PutExtra("key", "value"); if (intent.HasExtra("key")) { // Do something with the extra data }
Intent intent = new Intent(Intent.ActionSend); intent.SetType("text/plain"); intent.PutExtra(Intent.ExtraSubject, "Hello World"); intent.PutExtra(Intent.ExtraText, "This is my message"); if (intent.HasExtra(Intent.ExtraSubject)) { // Do something with the extra data }In this example, we create a new Intent object with the ActionSend action, set the MIME type to text/plain, and add some extra data using the PutExtra method. Then, we check whether the Intent object has extra data for a specific key (i.e., ExtraSubject). The package library for the Android.Content.Intent class is the Android.Content namespace.