简体   繁体   中英

Update android app if sql value is changed

I have email_status field in users column This email_status is INT(2) can be 1 or 0 When email_status is 0, then in client I need to see - "status 0" When email_status is 1, then in client I need to see - "status 1"

Problem When I change in DB to 0, REBUILD(!) app, then OK When I change in DB to 1, REBULT(!) app, then OK

But, Why I cannot see results without REBUILDING app?

I've tried the code bellow

        userDTO = prefrence.getParentUser(Consts.USER_DTO);
            if(userDTO.getEmail_status() == 1) {
                ProjectUtils.showToast(getActivity(), "statis1");
            }
                if(userDTO.getEmail_status() == 0) {
ProjectUtils.showToast(getActivity(), "status0");
                }
....
}

Try reloading the app. I think rebuilding the app is not required for database changes.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM