title: How do I create an android Intent that carries data?
body: <p>I might have misunderstood how intents are supposed to be used, so I might be asking the wrong thing here. If that's the case, please help me get on the right track with this anyway...</p>
  
  <p>I've just started working on an android app that will poll my server for messages every so often, and when a new message is available, I want to show it to the user. I'm trying to implement this by having a <code>Service</code> that polls the server, and when a new message is received  the service should give the message to an <code>Activity</code> that shows it.</p>
  
  <p>To facilitate this communication, I'm trying to create an <code>Intent</code> with <code>ACTION_VIEW</code>, but I can't figure out how to give the message to the activity. Is there no way to pass a string or a regular Java object via the intent?</p>
  
  <p>For what it's worth, this is what I'd like to do:</p>
  
  <pre><code>getApplication().startActivity(new Intent(MessageService.this, ViewMessageActivity.class, message));
  </code></pre>
  
  <p>but of course, that doesn't even compile.</p>