mirror of
https://github.com/moparisthebest/k-9
synced 2024-11-10 11:35:11 -05:00
Don't use EmailAddressAdapter as singleton
This commit is contained in:
parent
981c582e9e
commit
52b5c567ef
@ -25,22 +25,11 @@ import android.widget.ResourceCursorAdapter;
|
|||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
public class EmailAddressAdapter extends ResourceCursorAdapter {
|
public class EmailAddressAdapter extends ResourceCursorAdapter {
|
||||||
private static EmailAddressAdapter sInstance;
|
|
||||||
|
|
||||||
public static EmailAddressAdapter getInstance(Context context) {
|
|
||||||
if (sInstance == null) {
|
|
||||||
sInstance = new EmailAddressAdapter(context);
|
|
||||||
}
|
|
||||||
|
|
||||||
return sInstance;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private final Contacts mContacts;
|
private final Contacts mContacts;
|
||||||
|
|
||||||
private EmailAddressAdapter(Context context) {
|
public EmailAddressAdapter(Context context) {
|
||||||
super(context, R.layout.recipient_dropdown_item, null);
|
super(context, R.layout.recipient_dropdown_item, null);
|
||||||
mContacts = Contacts.getInstance(context);
|
mContacts = Contacts.getInstance(context.getApplicationContext());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -416,7 +416,7 @@ public class MessageCompose extends K9Activity implements OnClickListener, OnFoc
|
|||||||
|
|
||||||
mContacts = Contacts.getInstance(MessageCompose.this);
|
mContacts = Contacts.getInstance(MessageCompose.this);
|
||||||
|
|
||||||
mAddressAdapter = EmailAddressAdapter.getInstance(this);
|
mAddressAdapter = new EmailAddressAdapter(this);
|
||||||
mAddressValidator = new EmailAddressValidator();
|
mAddressValidator = new EmailAddressValidator();
|
||||||
|
|
||||||
mChooseIdentityButton = (Button) findViewById(R.id.identity);
|
mChooseIdentityButton = (Button) findViewById(R.id.identity);
|
||||||
|
Loading…
Reference in New Issue
Block a user