Пример #1
0
 public void Onclick(SnsPlatform snsPlatform, SHARE_MEDIA media)
 {
     if (snsPlatform.MShowWord.Equals("umeng_sharebutton_copy"))
     {
         try {
             ClipboardManager cm = (ClipboardManager)context.GetSystemService(Context.ClipboardService);
             // 将文本内容放到系统剪贴板里。
             cm.Text = umWeb.ToUrl();
             Toast.MakeText(context, "已复制链接到剪贴板", ToastLength.Short).Show();
         }
         catch (System.Exception ex) {
             Toast.MakeText(context, "很抱歉,浏览器打开失败", ToastLength.Short).Show();
         }
     }
     else if (snsPlatform.MShowWord.Equals("umeng_sharebutton_copyurl"))
     {
         try {
             Intent intent = new Intent(Intent.ActionView);
             intent.SetData(Android.Net.Uri.Parse(umWeb.ToUrl()));
             context.StartActivity(intent);
         }
         catch (System.Exception ex) {
             Toast.MakeText(context, "很抱歉,浏览器打开失败", ToastLength.Short).Show();
         }
     }
     else
     {
         new ShareAction(context).WithMedia(umWeb)
         .SetPlatform(media)
         .SetCallback(this)
         .Share();
     }
 }
Пример #2
0
 //IShareBoardListener
 public void Onclick(SnsPlatform snsPlatform, SHARE_MEDIA media)
 {
     if (snsPlatform.MShowWord.Equals("ä¯ÀÀÆ÷´ò¿ª"))
     {
         try
         {
             Intent intent = new Intent(Intent.ActionView);
             intent.SetData(Android.Net.Uri.Parse(umWeb.ToUrl()));
             context.StartActivity(intent);
         }
         catch (System.Exception e)
         {
             AlertUtil.ToastShort(context, "ä¯ÀÀÆ÷´ò¿ªÊ§°Ü");
         }
     }
     else
     {
         new ShareAction(context).WithMedia(umWeb)
         .SetPlatform(media)
         .SetCallback(this)
         .Share();
     }
 }
Пример #3
0
 public void Onclick(SnsPlatform snsPlatform, SHARE_MEDIA media)
 {
     if (snsPlatform.MShowWord.Equals("umeng_sharebutton_copy"))
     {
         try
         {
             Intent intent = new Intent(Intent.ActionView);
             intent.SetData(Android.Net.Uri.Parse(umWeb.ToUrl()));
             context.StartActivity(intent);
         }
         catch (System.Exception ex)
         {
             MobclickAgent.ReportError(context, ex.Message);
             Toast.MakeText(context, "很抱歉,浏览器打开失败", ToastLength.Short).Show();
         }
     }
     else
     {
         new ShareAction(context).WithMedia(umWeb)
         .SetPlatform(media)
         .SetCallback(this)
         .Share();
     }
 }