Fixed behavior of 'up'-buttons

This commit is contained in:
daniel oeh 2012-07-24 14:46:10 +02:00
parent 8243d0dde6
commit bc089c9e64
2 changed files with 9 additions and 2 deletions

View File

@ -1,5 +1,7 @@
package de.danoeh.antennapod.activity;
import android.annotation.SuppressLint;
import android.content.Intent;
import android.graphics.drawable.BitmapDrawable;
import android.os.AsyncTask;
import android.os.Bundle;
@ -77,6 +79,7 @@ public class FeedItemlistActivity extends SherlockFragmentActivity {
return FeedMenuHandler.onPrepareOptionsMenu(menu, feed);
}
@SuppressLint("NewApi")
@Override
public boolean onOptionsItemSelected(MenuItem item) {
if (FeedMenuHandler.onOptionsItemClicked(this, item, feed)) {
@ -99,7 +102,8 @@ public class FeedItemlistActivity extends SherlockFragmentActivity {
}
break;
case android.R.id.home:
finish();
startActivity(new Intent(this, MainActivity.class));
break;
}
}
return true;

View File

@ -2,6 +2,7 @@ package de.danoeh.antennapod.activity;
import java.text.DateFormat;
import android.content.Intent;
import android.graphics.drawable.BitmapDrawable;
import android.os.Bundle;
import android.support.v4.app.FragmentManager;
@ -108,7 +109,9 @@ public class ItemviewActivity extends SherlockFragmentActivity {
if (!FeedItemMenuHandler.onMenuItemClicked(this, menuItem, item)) {
switch (menuItem.getItemId()) {
case android.R.id.home:
finish();
Intent upIntent = new Intent(this, FeedItemlistActivity.class);
upIntent.putExtra(FeedlistFragment.EXTRA_SELECTED_FEED, item.getFeed().getId());
startActivity(upIntent);
break;
}
}