public void MAdapter_ItemClick(object sender, int position) { try { List <EmailResponse> emailListResponse = mAdapter.GetData(); EmailResponse emailResponseObj = emailListResponse[position]; if (emailResponseObj.Unread) { emailResponseObj.Unread = false; emailListResponse[position] = emailResponseObj; mAdapter.emailList = emailListResponse; mAdapter.NotifyItemChanged(position); // Call webservice for update read flag WebServiceMethods.MarkReadEmail(emailResponseObj.MailId); } string emailResponseString = JsonConvert.SerializeObject(emailResponseObj); Intent intent = new Intent(mActivity, typeof(EmailDetailActivity)); intent.PutExtra("emailResponseString", emailResponseString); intent.PutExtra("emailTypeId", emailTypeId); StartActivityForResult(intent, ConstantsDroid.EMAIL_DETAIL_REQUEST_CODE); } catch (Exception) { } }
async void markRead(string mailId) { await WebServiceMethods.MarkReadEmail(mailId); }