I solved my own question by adding the code below to the DefaultActivity.java file to prevent the default android behavior, and keeping the JavaScript code as stated in the question:
@Override
public void onBackPressed() {
return;
}
I hope this helps someone in the future with the same problem!