200 Apps interview question

Write a function in Java for Android, that creates an asynchronous task that fetches some data from the server. This task should be called before the activity is launched, and should update the activity's layout when completed. This is a writing code assignment.