![](/img/trans.png)
[英]ActivityNotFoundException even though it is declared in Manifest
[英]App shows two accessibility services even though only one is registered in manifest
我有一個在AndroidManifest.xml
中注冊輔助功能的應用程序,如下所示:
<service android:name="com.package.MyAccessibilityService"
android:permission="android.permission.BIND_ACCESSIBILITY_SERVICE"
android:enabled="@bool/is_lollipop_and_above"
android:exported="false">
<intent-filter>
<action android:name="android.accessibilityservice.AccessibilityService"/>
</intent-filter>
<meta-data android:name="android.accessibilityservice" android:resource="@xml/accessibilityservice" />
</service>
我的accessibilityservice.xml
看起來像這樣:
<accessibility-service xmlns:android="http://schemas.android.com/apk/res/android"
android:accessibilityFeedbackType="feedbackGeneric"
android:accessibilityFlags="flagDefault|flagReportViewIds"
android:canRetrieveWindowContent="true"
android:description="@string/accessibility_description"/>
效果很好,但是當我進入Android輔助功能設置時,我看到了我的應用服務的兩個版本:
第一個沒有任何描述,打開/關閉它似乎完全不影響我的應用程序的行為方式。
如果通過從清單文件中注釋掉該服務來禁用該服務,則無描述的服務仍然存在:
我不確定是什么原因造成的。 我嘗試搜索整個項目並注釋掉所有<service>
標記,但是重復的空服務仍然存在。 這是一個問題,因為我的應用程序直接引導用戶打開服務,但是總是有兩個服務看起來完全相同,並且只有其中一個用於啟用我的輔助功能。 任何想法可能是什么問題?
事實證明,我項目中包含的依賴項之一是綁定到可訪問性服務。 解決方案是刪除依賴項,或者如果您是作者並且不希望在那里使用可訪問性服務,請編輯依賴項。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.