Filtering the Hybrid App Messages

Filter the list of Hybrid App messages so only messages that meet specified criteria are shown.

The comment tag associated with Hybrid App messages is ANDROID_CUSTOMIZATION_POINT_FILTERING.

  1. Open the CustomizationHelper.java file, which is located in the ...\HybridWebContainer\src\com\sybase\hwc folder.
  2. Find the getFilteredMessages() method.
    The default behavior is to return all messages.
  3. To return a subset of messages, you can modify getFilteredMessages() to return a list of messages based on your criteria.
    For example, if you want only high priority messages to appear in the message list, you can change the code to the following:
    // Display high priority messages only.  
     ArrayList<Message> filteredMessages = MessageDb.getMessages( bCompleteList );   
    for( int iMessageIndex = 0; iMessageIndex < filteredMessages.size(); iMessageIndex++ )  
    {  
    if( filteredMessages.get(iMessageIndex).getMailPriority() != com.sybase.mo.AmpConsts.EMAIL_STATUS_IMPORTANCE_HIGH )  
    {  
    filteredMessages.remove(iMessageIndex);  
    //we need to decrement the index so we don't skip an element now  
    iMessageIndex--;  
    }  
    }  
    return filteredMessages; 
    
    You must refresh the listview before the new messages are filtered. You can refresh the listview by switching to another view and then switching back.