public class MobileApplication extends Application implements FolderListener { // Required method; executed when a message is added to the store. public void messagesAdded(FolderEvent e) { // Retrieve the message and folder it was added to. Message originalMessage = e.getMessage(); Folder messageFolder = originalMessage.getFolder(); // If the folder of the new message is the INBOX... if (messageFolder.getType() == Folder.INBOX) { // Get the message subject. String subject = originalMessage.getSubject(); // Check the subject line for the 'tag'. if (subject.indexOf("<TAG>") != -1) { // Kill the tone/vibrations that normally would occur when a message is received. NotificationsManager.cancelImmediateEvent(e.MESSAGE_ADDED, e.MESSAGE_ADDED, e, null); } } }}