mirror of
https://github.com/apache/cordova-android.git
synced 2025-02-26 20:33:07 +08:00
47 lines
669 B
Java
47 lines
669 B
Java
![]() |
package com.phonegap;
|
||
|
|
||
|
import android.app.Activity;
|
||
|
import android.util.Log;
|
||
|
import android.webkit.WebView;
|
||
|
|
||
|
/*
|
||
|
* This class literally exists to protect DroidGap from Javascript directly.
|
||
|
*
|
||
|
*
|
||
|
*/
|
||
|
|
||
|
|
||
|
public class BrowserKey {
|
||
|
|
||
|
DroidGap mAction;
|
||
|
boolean bound;
|
||
|
|
||
|
WebView mView;
|
||
|
|
||
|
BrowserKey(WebView view, DroidGap action)
|
||
|
{
|
||
|
bound = false;
|
||
|
}
|
||
|
|
||
|
public void override()
|
||
|
{
|
||
|
Log.d("PhoneGap", "WARNING: Back Button Default Behaviour will be overridden. The backKeyDown event will be fired!");
|
||
|
bound = true;
|
||
|
}
|
||
|
|
||
|
public boolean isBound()
|
||
|
{
|
||
|
return bound;
|
||
|
}
|
||
|
|
||
|
public void reset()
|
||
|
{
|
||
|
bound = false;
|
||
|
}
|
||
|
|
||
|
public void exitApp()
|
||
|
{
|
||
|
mAction.finish();
|
||
|
}
|
||
|
}
|