package net.rdrei.android.wakimail.ui;

import net.rdrei.android.wakimail.R;
import roboguice.activity.RoboFragmentActivity;
import android.net.Uri;
import android.os.Bundle;
import android.support.v4.app.FragmentTransaction;

import com.actionbarsherlock.app.ActionBar;

public class MailDetailActivity extends RoboFragmentActivity {
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);

		Uri uri = this.getIntent().getData();

		ActionBar actionBar = this.getSupportActionBar();
		actionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_HOME
				| ActionBar.DISPLAY_HOME_AS_UP | ActionBar.DISPLAY_SHOW_TITLE);

		setContentView(R.layout.activity_singlepane_empty);

		// First-time init; create fragment to embed in activity.
		FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
		MailDetailFragment newFragment = MailDetailFragment.newInstance(uri);
		ft.replace(R.id.root_container, newFragment);
		ft.commit();

	}
}

@@ -118,16 +118,47 @@
 tivity;%0A
+import android.content.Intent;%0A
 import a
@@ -294,16 +294,60 @@
 tionBar;
+%0Aimport com.actionbarsherlock.view.MenuItem;
 %0A%0Apublic
@@ -506,16 +506,22 @@
 te);%0A%0A%09%09
+final 
 Uri uri 
@@ -553,16 +553,22 @@
 a();%0A%0A%09%09
+final 
 ActionBa
@@ -853,16 +853,22 @@
 vity.%0A%09%09
+final 
 Fragment
@@ -911,16 +911,21 @@
 anager()
+%0A%09%09%09%09
 .beginTr
@@ -939,16 +939,22 @@
 on();%0A%09%09
+final 
 MailDeta
@@ -996,16 +996,21 @@
 Fragment
+%0A%09%09%09%09
 .newInst
@@ -1083,14 +1083,391 @@
 mmit();%0A
+%09%7D%0A%0A%09@Override%0A%09public boolean onOptionsItemSelected(MenuItem item) %7B%0A%09%09if (item.getItemId() == android.R.id.home) %7B%0A%09%09%09// The app icon was clicked, move up to list.%0A%09%09%09final Intent intent = new Intent(this, MailListActivity.class);%0A%09%09%09intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);%0A%09%09%09startActivity(intent);%0A%09%09%09return true;%0A%09%09%7D%0A%09%09%0A%09%09return super.onOptionsItemSelected(item);
 %0A%09%7D%0A%7D%0A

Use action bar icon to move up from Mail details