I have a login view in an android app that I would like to function synchronously. That is, I want the user to stay on the page until the login rest call completes. If it fails, the user can reenter their id and password. If it is successful they are routed to a welcome page.
Retrofit gives examples of how to make synchronous calls. But it comes with a warning that "synchronous requests trigger app crashes on Android 4.0 or newer. You’ll run into the NetworkOnMainThreadException
error." I've seen various responses on stackoverflow including using Otto and Robospice. Others to use homegrown listeners and others to use synchronous requests.
What would be the easiest, safest way to implement this functionality.