Converted hardcoded strings to constants

This commit is contained in:
cketti 2012-04-09 01:23:45 +02:00
parent 56d4cca4dd
commit 6f525f0e31
2 changed files with 8 additions and 3 deletions

View file

@ -13,6 +13,10 @@ import com.fsck.k9.R;
import com.fsck.k9.helper.ContactItem;
public class EmailAddressList extends K9ListActivity implements OnItemClickListener {
public static final String EXTRA_CONTACT_ITEM = "contact";
public static final String EXTRA_EMAIL_ADDRESS = "emailAddress";
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
@ -20,8 +24,9 @@ public class EmailAddressList extends K9ListActivity implements OnItemClickListe
setContentView(R.layout.email_address_list);
Intent i = getIntent();
ContactItem contact = (ContactItem) i.getSerializableExtra("contact");
ContactItem contact = (ContactItem) i.getSerializableExtra(EXTRA_CONTACT_ITEM);
if (contact == null) {
finish();
return;
}
@ -41,7 +46,7 @@ public class EmailAddressList extends K9ListActivity implements OnItemClickListe
Toast.makeText(EmailAddressList.this, item, Toast.LENGTH_LONG).show();
Intent intent = new Intent();
intent.putExtra("EMAIL_ADDRESS", item);
intent.putExtra(EXTRA_EMAIL_ADDRESS, item);
setResult(RESULT_OK, intent);
finish();
}

View file

@ -1804,7 +1804,7 @@ public class MessageCompose extends K9Activity implements OnClickListener, OnFoc
}
if (contact.emailAddresses.size() > 1) {
Intent i = new Intent(this, EmailAddressList.class);
i.putExtra("contact", contact);
i.putExtra(EmailAddressList.EXTRA_CONTACT_ITEM, contact);
if (requestCode == CONTACT_PICKER_TO) {
startActivityForResult(i, CONTACT_PICKER_TO2);