For example, if you want all but the low importance messages to appear in the
message list, you can change the code to the
following:
// Eliminate low importance messages.
ArrayList<Message> filteredMessages = MessageDb.getMessages();
for( int iMessageIndex = 0; iMessageIndex < filteredMessages.size(); iMessageIndex++ )
{
if( filteredMessages.get(iMessageIndex).getMailPriority() == com.sybase.mo.AmpConsts.EMAIL_STATUS_IMPORTANCE_LOW )
{
filteredMessages.remove(iMessageIndex);
//we need to decrement the index so we don't skip an element now
iMessageIndex--;
}
}
return filteredMessages;