mirror of
https://github.com/apache/cordova-android.git
synced 2026-02-21 00:02:46 +08:00
Removed PhoneGap.java, renaming to device and audio
This commit is contained in:
46
framework/src/com/phonegap/BrowserKey.java
Normal file
46
framework/src/com/phonegap/BrowserKey.java
Normal file
@@ -0,0 +1,46 @@
|
||||
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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user