aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/github/daneren2005/dsub/activity/SubsonicActivity.java1
-rw-r--r--src/github/daneren2005/dsub/fragments/SubsonicFragment.java4
2 files changed, 5 insertions, 0 deletions
diff --git a/src/github/daneren2005/dsub/activity/SubsonicActivity.java b/src/github/daneren2005/dsub/activity/SubsonicActivity.java
index d5821dac..5c355eaf 100644
--- a/src/github/daneren2005/dsub/activity/SubsonicActivity.java
+++ b/src/github/daneren2005/dsub/activity/SubsonicActivity.java
@@ -349,6 +349,7 @@ public class SubsonicActivity extends ActionBarActivity implements OnItemSelecte
menuInflater.inflate(R.menu.drawer_menu, menu);
} else if(currentFragment != null) {
try {
+ currentFragment.setContext(this);
currentFragment.onCreateOptionsMenu(menu, menuInflater);
} catch(Exception e) {
Log.w(TAG, "Error on creating options menu", e);
diff --git a/src/github/daneren2005/dsub/fragments/SubsonicFragment.java b/src/github/daneren2005/dsub/fragments/SubsonicFragment.java
index fcba86a2..1e2d2ad8 100644
--- a/src/github/daneren2005/dsub/fragments/SubsonicFragment.java
+++ b/src/github/daneren2005/dsub/fragments/SubsonicFragment.java
@@ -164,6 +164,10 @@ public class SubsonicFragment extends Fragment implements SwipeRefreshLayout.OnR
context = (SubsonicActivity)activity;
}
+ public void setContext(SubsonicActivity context) {
+ this.context = context;
+ }
+
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {