Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Converted hardcoded strings to constants

  • Loading branch information...
commit 6f525f0e31d43271654a06561aa422d7faac782e 1 parent 56d4cca
@cketti cketti authored
View
9 src/com/fsck/k9/activity/EmailAddressList.java
@@ -13,6 +13,10 @@
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 void onCreate(Bundle savedInstanceState) {
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 void onItemClick(AdapterView<?> parent, View view, int position, long id)
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
2  src/com/fsck/k9/activity/MessageCompose.java
@@ -1804,7 +1804,7 @@ protected void onActivityResult(int requestCode, int resultCode, Intent data) {
}
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);
Please sign in to comment.
Something went wrong with that request. Please try again.