Advertisement
Smile_Studio

update contact

Jan 17th, 2019
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Kotlin 1.14 KB | None | 0 0
  1. try {
  2.                                 var arrayList = GlobalApp().getInstance().daoSession?.contactDao?.queryBuilder()?.where(ContactDao.Properties.Phone.eq(it.phone), ContactDao.Properties.Phonelogin.eq(PhoneNumberUtils.convertPhone(GlobalApp().getInstance().profile?.phone)))?.list() as ArrayList<Contact>
  3.                                 if(arrayList!=null && !arrayList.isEmpty()){
  4.                                     arrayList.get(0).status = true
  5.                                     arrayList.get(0).thumb = it.thumb
  6.                                     arrayList.get(0).name = it.name
  7.                                     arrayList.get(0).ismember = it.ismember
  8.                                     arrayList.get(0).issub = it.issub
  9.                                     GlobalApp().getInstance().daoSession?.contactDao?.updateInTx(arrayList.get(0))
  10.                                     Debug.e("--- update thành công: ${it.phone} - isMember: ${it.ismember}")
  11.                                 }
  12.                             } catch (e: Exception) {
  13.                                 Debug.e("--- Lỗi update: ${it.phone}")
  14.                             }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement