1
如何在android上按全局熱鍵開始活動? 這是可能的,請參閱按鈕快捷方式的應用程序。android全局熱鍵
如何在android上按全局熱鍵開始活動? 這是可能的,請參閱按鈕快捷方式的應用程序。android全局熱鍵
這裏是 '搜索' 按鈕,該解決方案:
<intent-filter>
<action android:name="android.intent.action.SEARCH_LONG_PRESS" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
只是爲了存檔:
這(單獨)沒有幫助:
<uses-permission android:name="android.permission.GLOBAL_SEARCH" />
<activity android:name=".VoiceActions"
android:label="@string/app_name">
<!-- This must be higher than the default priority (0), which
is what GoogleSearch uses. -->
<intent-filter android:priority="500">
<action android:name="android.search.action.GLOBAL_SEARCH" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SEARCH" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<meta-data android:name="android.app.searchable"
android:resource="@xml/searchable" />
</activity>
<meta-data android:name="android.app.default_searchable"
android:value=".VoiceActions" />
</application>