private void displayMessages() {
   ArrayAdapter<String> adapter =
       new ArrayAdapter<String>(
           getApplicationContext(), R.layout.message_item, application.getMessages());
   listView.setAdapter(adapter);
 }
 private void addNewMessage(Bundle message) {
   application.addMessage(message.getString("alert"));
   displayMessages();
 }