Android Open Source - mailinglistmoderator Message View Activity






From Project

Back to project page mailinglistmoderator.

License

The source code is released under:

Copyright (c) 2010, Magnus Hagander All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:...

If you think the Android project mailinglistmoderator listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

/*
 * MessageViewActivity.java - This class holds the activity to view an individual message
 * /*from   ww w .  j  a  v a2s .c  o m*/
 * Copyright (C) 2010 Magnus Hagander <magnus@hagander.net>
 * 
 * This software is released under the BSD license.
 */
package net.hagander.mailinglistmoderator;

import net.hagander.mailinglistmoderator.backend.MailMessage;
import net.hagander.mailinglistmoderator.backend.MailMessage.statuslevel;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;

/**
 * 
 * @author Magnus Hagander <magnus@hagander.net>
 * 
 */
public class MessageViewActivity extends Activity {
  private MailMessage message;

  // Ugly hack to pass message to the activity when it's started
  private static MailMessage _passedMessage;

  public static void setMessage(MailMessage message) {
    _passedMessage = message;
  }

  public MessageViewActivity() {
    super();
    message = _passedMessage;
  }

  /** Called when the activity is first created. */
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    this.setTitle(message.getSubject());

    setContentView(R.layout.mailview);
    ((TextView) findViewById(R.id.TextView_Body)).setText(message
        .getContent());
    ((TextView) findViewById(R.id.TextView_Sender)).setText(
        String.format("From: %s\n", message.getSender()));
    ((Button) findViewById(R.id.Button_Accept)).setOnClickListener(new OnClickListener(){
      public void onClick(View v) {
        message.setStatus(statuslevel.Accept);
        finish();
      }});
    ((Button) findViewById(R.id.Button_Reject)).setOnClickListener(new OnClickListener(){
      public void onClick(View v) {
        message.setStatus(statuslevel.Reject);
        finish();
      }});
  }
}




Java Source Code List

net.hagander.mailinglistmoderator.MailinglistModerator.java
net.hagander.mailinglistmoderator.MessageViewActivity.java
net.hagander.mailinglistmoderator.QueueListActivity.java
net.hagander.mailinglistmoderator.ServerEditor.java
net.hagander.mailinglistmoderator.backend.ListServer.java
net.hagander.mailinglistmoderator.backend.MailMessage.java
net.hagander.mailinglistmoderator.backend.providers.Dummy.java
net.hagander.mailinglistmoderator.backend.providers.Mailman.java
net.hagander.mailinglistmoderator.backend.providers.Majordomo2.java
net.hagander.mailinglistmoderator.backend.providers.Unconfigured.java
net.hagander.mailinglistmoderator.glue.ListServerAdapter.java
net.hagander.mailinglistmoderator.glue.MailMessageAdapter.java
net.hagander.mailinglistmoderator.preferences.SSLCertDialogPreference.java