1

I am trying to search my app using google now voice command like: "Search something on APP_NAME".

And I am using it for my app Pluto (https://play.google.com/store/apps/details?id=com.tamal.voicesearch). Now the problem is this voice search was working 2 weeks back (for my other apps). Now it is not working in some of my devices but in some it is working. More interestingly in all these devices voice search is working for application like Flipkart.

One weird solution:

I spend a complete day on researching on this issue and then cleared the data of my Google app and uninstall the Updates and suddenly it started working on my Samsung S4 device (Android version: 5.0.1 and Google App version 7.8.22.21 ), please check the attachment. But in my other 2 devices Moto G4 (Android version: 7.0.0) and Nexus 5 (Android version: 6.0.1) it is still not working (even after clearing data and uninstalling updates of Google App). If I say "Search something on Pluto", it is doing web search.

I have researched but didn't get any explanation or solution for this behavior yet. Not understanding this inconsistency at all. I am using the following documentation for the same:

https://developer.android.com/guide/components/intents-common.html#Search https://www.youtube.com/watch?v=PS1FbB5qWEI

My code is very simple.. the the following in the manifest..

<activity android:name=".SearchableActivity">
    <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.VOICE" />
    </intent-filter>
</activity>

And in Activity fetching the Query string..

if (intent != null && ACTION_VOICE_SEARCH.equals(intent.getAction())) {
    String query = intent.getStringExtra(SearchManager.QUERY);
}

And

compileSdkVersion 26

Please help.

Working screen shot in Samsung S4

enter image description here

Not working screen shot in Moto G4

enter image description here

4

0 回答 0