取代谷歌现在的姿态姿态、现在

2023-09-12 10:55:34 作者:岁月无忧

,你刷卡机从导航栏一个简单的手势。我想要去替换这个功能用我自己的应用程序。如果你刷卡,应用程序选取器来问你哪些应用程序,你要开始:我的应用程序或谷歌现在。我怎样才能实现呢?

If you want to start Google Now on Nexus devices, you swipe-up with a simple gesture from the navbar. I want go replace this feature with my own app. if you swipe the, app-picker comes and asks you which app do you want to start: my app or Google Now. How can I implement this?

我发现 它没有root运行一个实例。

I have found an example which runs without root.

推荐答案

添加以下<意向滤光器> 来要从姿态推出的活动:

Add the following <intent-filter> to the Activity you want launched from the gesture:

<intent-filter>
    <action android:name="android.intent.action.ASSIST" />

    <category android:name="android.intent.category.DEFAULT" >
    </category>
</intent-filter>

当你刷一下现在现在您将看到您的应用程序的选项,并有选择总是选择它作为默认的处理程序,如下图所示。

You will now see an option for your app when you make the swipe now, and will have to select it as the default handler by selecting Always, as shown below.