[Android] Implement search from Google Now with VLC

Geoffrey Métais git at videolan.org
Thu Nov 3 11:34:12 CET 2016


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Fri Sep 30 17:11:56 2016 +0200| [1ba634839245fb5e6890396ef290355ee2c1a590] | committer: Geoffrey Métais

Implement search from Google Now with VLC

> https://code.videolan.org/videolan/vlc-android/commit/1ba634839245fb5e6890396ef290355ee2c1a590
---

 vlc-android/AndroidManifest.xml                          | 4 ++++
 vlc-android/src/org/videolan/vlc/gui/SearchActivity.java | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/vlc-android/AndroidManifest.xml b/vlc-android/AndroidManifest.xml
index 811a938..fd8bba2 100644
--- a/vlc-android/AndroidManifest.xml
+++ b/vlc-android/AndroidManifest.xml
@@ -443,6 +443,10 @@
             <intent-filter>
                 <action android:name="android.intent.action.SEARCH" />
             </intent-filter>
+            <intent-filter>
+                <action android:name="com.google.android.gms.actions.SEARCH_ACTION"/>
+                <category android:name="android.intent.category.DEFAULT"/>
+            </intent-filter>
             <meta-data android:name="android.app.searchable"
                 android:resource="@xml/searchable"/>
         </activity>
diff --git a/vlc-android/src/org/videolan/vlc/gui/SearchActivity.java b/vlc-android/src/org/videolan/vlc/gui/SearchActivity.java
index f1ce87d..22e41ac 100644
--- a/vlc-android/src/org/videolan/vlc/gui/SearchActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/SearchActivity.java
@@ -41,7 +41,7 @@ public class SearchActivity extends AppCompatActivity implements TextWatcher, Te
         if (PreferenceManager.getDefaultSharedPreferences(this).getBoolean("enable_black_theme", false))
             setTheme(R.style.Theme_VLC_Black);
         Intent intent = getIntent();
-        if (Intent.ACTION_SEARCH.equals(intent.getAction())) {
+        if (Intent.ACTION_SEARCH.equals(intent.getAction()) || "com.google.android.gms.actions.SEARCH_ACTION".equals(intent.getAction())) {
             mBinding = DataBindingUtil.setContentView(this, R.layout.search_activity);
             mBinding.setHandler(mClickHandler);
             mMedialibrary = VLCApplication.getMLInstance();



More information about the Android mailing list