protected override void OnPostExecute(JsonResult result) { base.OnPostExecute(result); p.Dismiss(); if (result != null) { if (result.Success == true) { if (result.Message == "Following") { contact.isFriend = true; inviteContactAdapter.NotifyDataSetChanged(); } else if (result.Message == "Friend Request sent") { contact.isFriendRequestPending = true; inviteContactAdapter.NotifyDataSetChanged(); } else if (result.Message == "Invited") { contact.isInvited = true; inviteContactAdapter.NotifyDataSetChanged(); } if (friendRequest.SendToMobile != null) { Intent intent = new Intent(Intent.ActionView); intent.PutExtra("address", friendRequest.SendToMobile); intent.PutExtra("sms_body", "Download weclip from http://www.weclip.com"); intent.SetData(Uri.Parse("smsto:" + friendRequest.SendToMobile)); context.StartActivity(intent); } // btnSendInvite.SetBackgroundResource(Resource.Drawable.btn_round_green_border_fill_padding); // btnSendInvite.SetTextColor(Color.ParseColor("#ffffff")); } else { Toast.MakeText(context, "Error", ToastLength.Short).Show(); } } }
private void GetAllContacts() { try { var listContacts = new ObservableCollection<Methods.PhoneContactManager.UserContact>(Methods.PhoneContactManager.GetAllContacts()); var orderByDate = listContacts.OrderBy(a => a.UserDisplayName); //Set Adapter MAdapter.UsersPhoneContacts = new ObservableCollection<Methods.PhoneContactManager.UserContact>(orderByDate); MAdapter.NotifyDataSetChanged(); InviteSmsText = GetText(Resource.String.Lbl_InviteSMSText_1) + " " + AppSettings.ApplicationName + " " + GetText(Resource.String.Lbl_InviteSMSText_2); } catch (Exception e) { Console.WriteLine(e); } }