Intercept long media button press and disable Google Now

1k views Asked by At

I wish to start a reciever\service that recieves the long press from the headset button and disables the Google Now voice recognition feature. Is that possible or is the Google Now response hard-coded to be in higher priority prior to Jelly Bean?

Thanks!

1

There are 1 answers

0
Rachit Mishra On

This is how I have implemented it listening to LongPress of volume key.

@Override
    public boolean onKeyLongPress(int keyCode, KeyEvent event) {
        if (keyCode == KeyEvent.KEYCODE_VOLUME_DOWN) 
        {
            // do something here
            return true;
        }
        return super.onKeyLongPress(keyCode, event);
    }