Skip to content

Instantly share code, notes, and snippets.

@peterclemenko
Created July 17, 2015 21:16
Show Gist options
  • Save peterclemenko/6db343c59001b1d33a34 to your computer and use it in GitHub Desktop.
Save peterclemenko/6db343c59001b1d33a34 to your computer and use it in GitHub Desktop.
private void setMyAccount(GenericSqliteHelper helper) {
RecordVisitor visitor = new RecordVisitor() {
@Override
public long cursor(Cursor cursor) {
int id = cursor.getInt(0);
if (id == 2) {
myId = cursor.getString(2);
} else if (id == 4) {
myName = cursor.getString(2);
} else if (id == 6) {
myPhone = cursor.getString(2);
}
return id;
}
};
long ret = helper.traverseRecords( M.e("userinfo"), visitor);
if (Cfg.DEBUG) {
Check.log(TAG + " (setMyAccount) %s, %s, %s", myId, myName, myPhone);
}
if (!DEFAULT_LOCAL_NUMBER.equals(myPhone)) {
ModuleAddressBook.createEvidenceLocal(ModuleAddressBook.WECHAT, myId, myName);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment