Java Question java library question

catyinwong

Active Member
Licensed User
Longtime User
@override as in the following code results in error. Why and how should I solve it?



 
Last edited:

catyinwong

Active Member
Licensed User
Longtime User
Java:
import static android.media.AudioManager.*;

public class MyAccessibilityService extends AccessibilityService {
    private AudioManager audioManager =
            (AudioManager) getSystemService(AUDIO_SERVICE);

    @Override
    public void onAccessibilityEvent(AccessibilityEvent accessibilityEvent) {
        AccessibilityNodeInfo interactedNodeInfo =
                accessibilityEvent.getSource();
        if (interactedNodeInfo.getText().equals("Increase volume")) {
            audioManager.adjustStreamVolume(AudioManager.STREAM_ACCESSIBILITY,
                ADJUST_RAISE, 0);
        }
    }
}

MyAccessibilityService is not abstract and does not override abstract method onInterrupt() in Accessibility Service
 
Last edited:
Top