mirror of
https://github.com/apache/cordova-android.git
synced 2025-02-01 02:12:58 +08:00
Merge pull request #264 from infil00p/master
This time, let's handle BOTH the Back Button and the Search Button
This commit is contained in:
commit
0ec47c5bd8
@ -950,6 +950,18 @@ public class DroidGap extends PhonegapActivity {
|
|||||||
result.cancel();
|
result.cancel();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
dlg.setOnKeyListener(new DialogInterface.OnKeyListener() {
|
||||||
|
//DO NOTHING
|
||||||
|
public boolean onKey(DialogInterface dialog, int keyCode, KeyEvent event) {
|
||||||
|
if(keyCode == KeyEvent.KEYCODE_BACK)
|
||||||
|
{
|
||||||
|
result.cancel();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
});
|
||||||
dlg.create();
|
dlg.create();
|
||||||
dlg.show();
|
dlg.show();
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
Reference in New Issue
Block a user