There are a few ways to approach this depending on how you want the login experience to be for your user. Here's one way just to illustrate how the parts could fit together.
Start by having a login credentials activity where users enter their credentials. This activity could be the main activity, started by the main activity, or perhaps started by clicking a login button somewhere.
In the onClick handler for the login credentials activity's login button, start a login activity. This login activity will present some kind of logging in message to the user, perhaps with an indeterminate progress feature and a cancel button. Start the login activity using startActivityForResult(Intent, int). See
Starting an activity for a result in the Android Dev Guide.
The login activity will return the success status of the login to the login credentials activity. If the login was not successful, the login credentials activity can display an alert dialog before allow the user to try again with different credentials. If the login was successful, then the login credentials activity can start the home UI activity for your app or return to the activity that start it.
In login activity's onCreate(), initialise an instance of an AsyncTask subclass. This AsyncTask subclass will do the network communication for logging in and downloading the preferences. It will do all of this in its doInBackground(Params...) method. The AsyncTask subclass's constructor will include an parameter for passing in the login activity. In the AsyncTask subclass's onPostExecute(Result) method, it calls login activity's setResult(int) or setResult(int, Intent) method and then the finish() method.
This will cause a cascade of the login activity finishing and then login credential's onActivityResult(int, int, Intent) method. You'd override this method to react depending on the result code.
Hopefully I've mentioned all the pieces and haven't left anything out. I'm still a bit groggy from New Year's Eve. Feel free to ask more questions.