public void OnItemClick(AdapterView parent, View view, int position, long id) { var t = codesString[position]; var clipboardManager = (ClipboardManager)this.GetSystemService(Context.ClipboardService); var message = "Copied " + t + " to clipboard"; Android.Content.ClipData clip = Android.Content.ClipData.NewPlainText(t, t); clipboardManager.PrimaryClip = clip; Toast.MakeText(this, message, ToastLength.Short).Show(); }
public override void OnReceive(Context context, Intent intent) { var clipboardManager = (ClipboardManager)context.GetSystemService(Context.ClipboardService); var message = intent.GetStringExtra("message"); Android.Content.ClipData clip = Android.Content.ClipData.NewPlainText(message, message); clipboardManager.PrimaryClip = clip; // Start Ingress Intent launchIngressIntent = context.PackageManager.GetLaunchIntentForPackage("com.nianticproject.ingress"); context.StartActivity(launchIngressIntent); }