diff --git a/src/com/android/email/activity/setup/AccountSetupNames.java b/src/com/android/email/activity/setup/AccountSetupNames.java index 9b9349ed2..99e23676b 100644 --- a/src/com/android/email/activity/setup/AccountSetupNames.java +++ b/src/com/android/email/activity/setup/AccountSetupNames.java @@ -130,14 +130,20 @@ public class AccountSetupNames extends AccountSetupActivity implements OnClickLi } private void prefillNameFromProfile() { - EmailAsyncTask.runAsyncParallel(new Runnable() { + new EmailAsyncTask(null) { @Override - public void run() { + protected String doInBackground(Void... params) { String[] projection = new String[] { Profile.DISPLAY_NAME }; - mName.setText(Utility.getFirstRowString( - AccountSetupNames.this, PROFILE_URI, projection, null, null, null, 0)); + return Utility.getFirstRowString( + AccountSetupNames.this, PROFILE_URI, projection, null, null, null, 0); } - }); + + @Override + public void onSuccess(String result) { + // Views can only be modified on the main thread. + mName.setText(result); + } + }.executeParallel((Void[]) null); } /**