Merge "Clear notifications when deleting accounts"

This commit is contained in:
Andrew Stadler 2010-03-17 19:49:44 -07:00 committed by Android (Google) Code Review
commit f223af1392

View File

@ -32,6 +32,7 @@ import com.android.email.provider.EmailContent.Mailbox;
import com.android.email.provider.EmailContent.MailboxColumns;
import com.android.email.provider.EmailContent.Message;
import com.android.email.provider.EmailContent.MessageColumns;
import com.android.email.service.MailService;
import android.app.AlertDialog;
import android.app.Dialog;
@ -415,6 +416,10 @@ public class AccountFolderList extends ListActivity implements OnItemClickListen
public void onClick(DialogInterface dialog, int whichButton) {
dismissDialog(DIALOG_REMOVE_ACCOUNT);
try {
// Clear notifications, which may become stale here
NotificationManager notificationManager = (NotificationManager)
getSystemService(Context.NOTIFICATION_SERVICE);
notificationManager.cancel(MailService.NOTIFICATION_ID_NEW_MESSAGES);
// Delete Remote store at first.
Store.getInstance(
mSelectedContextAccount.getStoreUri(AccountFolderList.this),