diff --git a/src/de/podfetcher/activity/DownloadActivity.java b/src/de/podfetcher/activity/DownloadActivity.java index dddda6f4a..0bfa0cbae 100644 --- a/src/de/podfetcher/activity/DownloadActivity.java +++ b/src/de/podfetcher/activity/DownloadActivity.java @@ -44,6 +44,7 @@ public class DownloadActivity extends SherlockListActivity implements super.onCreate(savedInstanceState); Log.d(TAG, "Creating Activity"); requester = DownloadRequester.getInstance(); + getSupportActionBar().setDisplayHomeAsUpEnabled(true); } @@ -104,6 +105,9 @@ public class DownloadActivity extends SherlockListActivity implements @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { + case android.R.id.home: + finish(); + break; case MENU_SHOW_LOG: startActivity(new Intent(this, DownloadLogActivity.class)); break; diff --git a/src/de/podfetcher/activity/DownloadLogActivity.java b/src/de/podfetcher/activity/DownloadLogActivity.java index 1347fc0ad..661f9d476 100644 --- a/src/de/podfetcher/activity/DownloadLogActivity.java +++ b/src/de/podfetcher/activity/DownloadLogActivity.java @@ -6,30 +6,40 @@ import com.actionbarsherlock.app.SherlockListActivity; import com.actionbarsherlock.view.Menu; import com.actionbarsherlock.view.MenuItem; -import de.podfetcher.R; import de.podfetcher.adapter.DownloadLogAdapter; import de.podfetcher.feed.FeedManager; public class DownloadLogActivity extends SherlockListActivity { private static final String TAG = "DownloadLogActivity"; - + DownloadLogAdapter dla; FeedManager manager; - - - + @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); manager = FeedManager.getInstance(); - + dla = new DownloadLogAdapter(this, 0, manager.getDownloadLog()); + getSupportActionBar().setDisplayHomeAsUpEnabled(true); setListAdapter(dla); } - - - - - - + + @Override + public boolean onCreateOptionsMenu(Menu menu) { + return true; + } + + @Override + public boolean onOptionsItemSelected(MenuItem item) { + switch (item.getItemId()) { + case android.R.id.home: + finish(); + break; + default: + return false; + } + return true; + } + } diff --git a/src/de/podfetcher/activity/MediaplayerActivity.java b/src/de/podfetcher/activity/MediaplayerActivity.java index 134ca7204..dc3d5aeff 100644 --- a/src/de/podfetcher/activity/MediaplayerActivity.java +++ b/src/de/podfetcher/activity/MediaplayerActivity.java @@ -40,6 +40,7 @@ import android.widget.ViewSwitcher; import com.actionbarsherlock.app.SherlockActivity; import com.actionbarsherlock.app.SherlockFragmentActivity; import com.actionbarsherlock.view.Menu; +import com.actionbarsherlock.view.MenuItem; import com.actionbarsherlock.view.Window; import com.viewpagerindicator.TabPageIndicator; @@ -124,8 +125,19 @@ public class MediaplayerActivity extends SherlockFragmentActivity implements @Override public boolean onCreateOptionsMenu(Menu menu) { - // TODO Auto-generated method stub - return super.onCreateOptionsMenu(menu); + return true; + } + + @Override + public boolean onOptionsItemSelected(MenuItem item) { + switch (item.getItemId()) { + case android.R.id.home: + finish(); + break; + default: + return false; + } + return true; } @Override @@ -172,7 +184,7 @@ public class MediaplayerActivity extends SherlockFragmentActivity implements orientation = getResources().getConfiguration().orientation; manager = FeedManager.getInstance(); getWindow().setFormat(PixelFormat.TRANSPARENT); - + getSupportActionBar().setDisplayHomeAsUpEnabled(true); bindToService(); } @@ -665,8 +677,7 @@ public class MediaplayerActivity extends SherlockFragmentActivity implements holderCreated = false; } - public static class MediaPlayerPagerAdapter extends - FragmentPagerAdapter { + public static class MediaPlayerPagerAdapter extends FragmentPagerAdapter { private int numItems; private MediaplayerActivity activity; diff --git a/src/de/podfetcher/activity/PreferenceActivity.java b/src/de/podfetcher/activity/PreferenceActivity.java index 8701474ee..fc6ee19fa 100644 --- a/src/de/podfetcher/activity/PreferenceActivity.java +++ b/src/de/podfetcher/activity/PreferenceActivity.java @@ -3,6 +3,8 @@ package de.podfetcher.activity; import android.os.Bundle; import com.actionbarsherlock.app.SherlockPreferenceActivity; +import com.actionbarsherlock.view.Menu; +import com.actionbarsherlock.view.MenuItem; import de.podfetcher.R; @@ -10,6 +12,25 @@ public class PreferenceActivity extends SherlockPreferenceActivity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + getSupportActionBar().setDisplayHomeAsUpEnabled(true); addPreferencesFromResource(R.xml.preferences); } + + @Override + public boolean onCreateOptionsMenu(Menu menu) { + return true; + } + + @Override + public boolean onOptionsItemSelected(MenuItem item) { + switch (item.getItemId()) { + case android.R.id.home: + finish(); + break; + default: + return false; + } + return true; + } + }