diff options
-rw-r--r-- | AndroidManifest.xml | 6 | ||||
-rw-r--r-- | src/github/daneren2005/dsub/activity/VoiceQueryReceiverActivity.java | 5 |
2 files changed, 10 insertions, 1 deletions
diff --git a/AndroidManifest.xml b/AndroidManifest.xml index bf2262cb..69ba90e3 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -66,6 +66,12 @@ <action android:name="android.media.action.MEDIA_PLAY_FROM_SEARCH" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
+
+ <intent-filter>
+ <action android:name="com.google.android.gms.actions.SEARCH_ACTION"/>
+ <category android:name="android.intent.category.DEFAULT" />
+ <category android:name="android.intent.category.BROWSABLE" />
+ </intent-filter>
</activity>
<activity android:name="github.daneren2005.dsub.activity.QueryReceiverActivity"
diff --git a/src/github/daneren2005/dsub/activity/VoiceQueryReceiverActivity.java b/src/github/daneren2005/dsub/activity/VoiceQueryReceiverActivity.java index f3a56920..7ae0ba77 100644 --- a/src/github/daneren2005/dsub/activity/VoiceQueryReceiverActivity.java +++ b/src/github/daneren2005/dsub/activity/VoiceQueryReceiverActivity.java @@ -38,6 +38,7 @@ import github.daneren2005.dsub.provider.DSubSearchProvider; * @author Sindre Mehus */ public class VoiceQueryReceiverActivity extends Activity { + private static String GMS_SEARCH_ACTION = "com.google.android.gms.actions.SEARCH_ACTION"; @Override public void onCreate(Bundle savedInstanceState) { @@ -48,7 +49,9 @@ public class VoiceQueryReceiverActivity extends Activity { if (query != null) { Intent intent = new Intent(VoiceQueryReceiverActivity.this, SubsonicFragmentActivity.class); intent.putExtra(Constants.INTENT_EXTRA_NAME_QUERY, query); - intent.putExtra(Constants.INTENT_EXTRA_NAME_AUTOPLAY, true); + if(!GMS_SEARCH_ACTION.equals(getIntent().getAction())) { + intent.putExtra(Constants.INTENT_EXTRA_NAME_AUTOPLAY, true); + } intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_CLEAR_TOP); Util.startActivityWithoutTransition(VoiceQueryReceiverActivity.this, intent); } |