Code example for Context

Methods: getContentResolvergetSystemService

    private final ContentResolver mContentResolver;
    private final AudioManager mAudioManager;
    public ObscureSpeechDelegate(Context context) {
        mContentResolver = context.getContentResolver();
        mAudioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
    public void sendAccessibilityEvent(View host, int eventType) {
        super.sendAccessibilityEvent(host, eventType);
        // Play the "headset required" announcement the first time the user 
        // places accessibility focus on a key. 
        if ((eventType == AccessibilityEvent.TYPE_VIEW_ACCESSIBILITY_FOCUSED)
                && !sAnnouncedHeadset && shouldObscureSpeech()) {
            sAnnouncedHeadset = true;
Connect your IDE to all the code out there  Get Codota for Java