The cause of akvo/akvo-flow#1731
When app is run for the first time, it puts up AddUserActivity to ask for user name and device id, but in the background SurveyDownloadService immediately queries the server for surveys, at which point it appears in the device list. Unless there are network problems, this happens before the device ID has been set, so until the next survey check, it will be in the device list without the user-set ID. AddUserActivity does not, in contrast with PreferencesActivity, start SurveyDownloadService to propagate the new device ID.
Suggested solution:
In SurveyActivity, if AddUserActivity is called, skip starting SurveyDownloadService.
In AddUserActivity, start SurveyDownloadService when a device ID has been set. (Exactly like in PreferencesActivity.)
Alternatively, we could do just 2. which will at least minimise the window during which a device without an ID is visible.
The cause of akvo/akvo-flow#1731 When app is run for the first time, it puts up AddUserActivity to ask for user name and device id, but in the background SurveyDownloadService immediately queries the server for surveys, at which point it appears in the device list. Unless there are network problems, this happens before the device ID has been set, so until the next survey check, it will be in the device list without the user-set ID. AddUserActivity does not, in contrast with PreferencesActivity, start SurveyDownloadService to propagate the new device ID.
Suggested solution: