aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordaneren2005 <daneren2005@gmail.com>2013-11-26 11:34:57 -0800
committerdaneren2005 <daneren2005@gmail.com>2013-11-26 11:34:57 -0800
commit9e52c5901e11a29b43b26db79e837f0a3279f6bb (patch)
tree521c88535479fbc70d0a9af56ea5960379a2c7fb
parenteb12a600db94d7dbc8b69cffbe1dc2fb303718cc (diff)
downloaddsub-9e52c5901e11a29b43b26db79e837f0a3279f6bb.tar.gz
dsub-9e52c5901e11a29b43b26db79e837f0a3279f6bb.tar.bz2
dsub-9e52c5901e11a29b43b26db79e837f0a3279f6bb.zip
Move onNewIntent to frag activity
-rw-r--r--src/github/daneren2005/dsub/activity/SubsonicFragmentActivity.java27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/github/daneren2005/dsub/activity/SubsonicFragmentActivity.java b/src/github/daneren2005/dsub/activity/SubsonicFragmentActivity.java
index faab81bb..5cee3093 100644
--- a/src/github/daneren2005/dsub/activity/SubsonicFragmentActivity.java
+++ b/src/github/daneren2005/dsub/activity/SubsonicFragmentActivity.java
@@ -206,6 +206,33 @@ public class SubsonicFragmentActivity extends SubsonicActivity {
changeLog.getLogDialog().show();
}
}
+
+ @Override
+ public void onNewIntent(Intent intent) {
+ super.onNewIntent(intent);
+
+ if(currentFragment != null && currentFragment instanceof SearchFragment) {
+ String query = intent.getStringExtra(Constants.INTENT_EXTRA_NAME_QUERY);
+ boolean autoplay = intent.getBooleanExtra(Constants.INTENT_EXTRA_NAME_AUTOPLAY, false);
+ boolean requestsearch = intent.getBooleanExtra(Constants.INTENT_EXTRA_REQUEST_SEARCH, false);
+
+ if (query != null) {
+ ((SearchFragment)currentFragment).search(query, autoplay);
+ } else {
+ ((SearchFragment)currentFragment).populateList();
+ if (requestsearch) {
+ onSearchRequested();
+ }
+ }
+ } else if(currentFragment != null && intent.getStringExtra(Constants.INTENT_EXTRA_NAME_QUERY) != null) {
+ setIntent(intent);
+
+ SearchFragment fragment = new SearchFragment();
+ replaceFragment(fragment, currentFragment.getRootId(), fragment.getSupportTag());
+ } else {
+ setIntent(intent);
+ }
+ }
@Override
public void onResume() {