3
我正在使用這些權限並從大約10個不同的應用中檢索內容。有沒有更好的方法來減少電池消耗?輔助功能服務消耗大量電池
<accessibility-service
android:description="@string/accessibility_service_description"
android:accessibilityEventTypes="typeViewClicked|typeViewFocused|typeWindowStateChanged"
android:accessibilityFeedbackType="feedbackGeneric"
android:notificationTimeout="100"
android:canRetrieveWindowContent="true"
xmlns:android="http://schemas.android.com/apk/res/android" />
閱讀活動在無障礙服務:
@Override
public void onAccessibilityEvent(AccessibilityEvent event) {
final int eventType = event.getEventType();
String eventText = null;
switch(eventType) {
case AccessibilityEvent.TYPE_VIEW_CLICKED:
eventText = "Focused: ";
break;
case AccessibilityEvent.TYPE_VIEW_FOCUSED:
eventText = "Focused: ";
break;
}
eventText = eventText + event.getContentDescription();
// Do something nifty with this text, like speak the composed string
// back to the user.
speakToUser(eventText);
...
}
在說明電池壽命之前,您是如何測試的? – GvSharma