diff options
author | Scott Jackson <daneren2005@gmail.com> | 2013-04-30 21:25:29 -0700 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2013-04-30 21:25:29 -0700 |
commit | 7961a0d41fcdd6c6a6ebf35c3af518be8f37bbac (patch) | |
tree | af3051568ded310b07044d3a9bc6814452daeebe | |
parent | 7dc30aa70593f6dfc612f681ff9b1f3b14d62e4a (diff) | |
download | dsub-7961a0d41fcdd6c6a6ebf35c3af518be8f37bbac.tar.gz dsub-7961a0d41fcdd6c6a6ebf35c3af518be8f37bbac.tar.bz2 dsub-7961a0d41fcdd6c6a6ebf35c3af518be8f37bbac.zip |
Setup Download Activity to be able to use backStack as well
-rw-r--r-- | subsonic-android/src/github/daneren2005/dsub/activity/DownloadActivity.java | 11 | ||||
-rw-r--r-- | subsonic-android/src/github/daneren2005/dsub/fragments/DownloadFragment.java | 1 |
2 files changed, 5 insertions, 7 deletions
diff --git a/subsonic-android/src/github/daneren2005/dsub/activity/DownloadActivity.java b/subsonic-android/src/github/daneren2005/dsub/activity/DownloadActivity.java index 24f8181f..b78724da 100644 --- a/subsonic-android/src/github/daneren2005/dsub/activity/DownloadActivity.java +++ b/subsonic-android/src/github/daneren2005/dsub/activity/DownloadActivity.java @@ -44,7 +44,6 @@ import java.util.List; public class DownloadActivity extends SubsonicActivity { private static final String TAG = DownloadActivity.class.getSimpleName(); - private static DownloadFragment fragment; private EditText playlistNameView; /** @@ -56,8 +55,8 @@ public class DownloadActivity extends SubsonicActivity { setContentView(R.layout.download_activity); if (findViewById(R.id.download_container) != null && savedInstanceState == null) { - fragment = new DownloadFragment(); - getSupportFragmentManager().beginTransaction().add(R.id.download_container, fragment).commit(); + currentFragment = new DownloadFragment(); + getSupportFragmentManager().beginTransaction().add(R.id.download_container, currentFragment).commit(); } getSupportActionBar().setDisplayHomeAsUpEnabled(true); @@ -73,14 +72,14 @@ public class DownloadActivity extends SubsonicActivity { startActivity(i); return true; } else { - return false; + return super.onOptionsItemSelected(item); } } @Override public boolean onTouchEvent(MotionEvent me) { - if(fragment != null) { - return fragment.getGestureDetector().onTouchEvent(me); + if(currentFragment != null) { + return ((DownloadFragment)currentFragment).getGestureDetector().onTouchEvent(me); } else { return false; } diff --git a/subsonic-android/src/github/daneren2005/dsub/fragments/DownloadFragment.java b/subsonic-android/src/github/daneren2005/dsub/fragments/DownloadFragment.java index 5093934b..7ec4d5c7 100644 --- a/subsonic-android/src/github/daneren2005/dsub/fragments/DownloadFragment.java +++ b/subsonic-android/src/github/daneren2005/dsub/fragments/DownloadFragment.java @@ -116,7 +116,6 @@ public class DownloadFragment extends SubsonicFragment implements OnGestureListe @Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle bundle) {
rootView = inflater.inflate(R.layout.download, container, false);
- setHasOptionsMenu(true);
setTitle(nowPlaying ? "Now Playing" : "Downloading");
WindowManager w = context.getWindowManager();
|