diff options
Diffstat (limited to 'src/github/daneren2005/dsub/activity/SubsonicFragmentActivity.java')
-rw-r--r-- | src/github/daneren2005/dsub/activity/SubsonicFragmentActivity.java | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/src/github/daneren2005/dsub/activity/SubsonicFragmentActivity.java b/src/github/daneren2005/dsub/activity/SubsonicFragmentActivity.java index e74f6ff3..08acf591 100644 --- a/src/github/daneren2005/dsub/activity/SubsonicFragmentActivity.java +++ b/src/github/daneren2005/dsub/activity/SubsonicFragmentActivity.java @@ -211,24 +211,26 @@ public class SubsonicFragmentActivity extends SubsonicActivity { public void onNewIntent(Intent intent) {
super.onNewIntent(intent);
- if(currentFragment != null && currentFragment instanceof SearchFragment && intent.getStringExtra(Constants.INTENT_EXTRA_NAME_QUERY) != null) {
- 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();
+ if(currentFragment != null && intent.getStringExtra(Constants.INTENT_EXTRA_NAME_QUERY) != null) {
+ if(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);
+ } else {
+ setIntent(intent);
- SearchFragment fragment = new SearchFragment();
- replaceFragment(fragment, currentFragment.getRootId(), fragment.getSupportTag());
+ SearchFragment fragment = new SearchFragment();
+ replaceFragment(fragment, currentFragment.getRootId(), fragment.getSupportTag());
+ }
} else {
setIntent(intent);
}
|