I'd like to reduce volume button keypress delay on android devices. I have a Nexus 5 and tested that when i press on the screen, the response time is very smooth, but it's not for volume button keypress.
This is my code:
Button send;
send = (Button) findViewById(R.id.send);
send.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
text.setText("Hello world!");
}
});
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if ((keyCode == KeyEvent.KEYCODE_VOLUME_DOWN)){
text.setText("Hello world!)";
}
return true;
}
The delay between the hardware button press and the Button press on the touchscreen is about 0.2sec.
Is there a way to improve keypress response performance? My phone is rooted. Solutions for rooted devices accepted too.
Thank you
0 comments:
Post a Comment