Permalink
Browse files

added @JavascriptInterface

  • Loading branch information...
commonsguy committed Feb 19, 2013
1 parent d80e7c6 commit 4d16b19cd158b15200ea59bb71b8c5bee8f91eb1
@@ -8,4 +8,4 @@
# project structure.
# Project target.
-target=android-8
+target=android-17
@@ -14,12 +14,14 @@
package com.commonsware.android.geoweb;
+import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.Context;
-import android.os.Bundle;
import android.location.Location;
import android.location.LocationListener;
import android.location.LocationManager;
+import android.os.Bundle;
+import android.webkit.JavascriptInterface;
import android.webkit.WebView;
import org.json.JSONException;
import org.json.JSONObject;
@@ -29,6 +31,7 @@
private WebView browser;
private LocationManager myLocationManager=null;
+ @SuppressLint("SetJavaScriptEnabled")
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
@@ -77,6 +80,7 @@ public void onStatusChanged(String provider, int status,
};
public class Locater {
+ @JavascriptInterface
public String getLocation() throws JSONException {
Location loc=myLocationManager.getLastKnownLocation(PROVIDER);
@@ -8,4 +8,4 @@
# project structure.
# Project target.
-target=android-8
+target=android-17
@@ -14,12 +14,14 @@
package com.commonsware.android.geoweb2;
+import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.Context;
-import android.os.Bundle;
import android.location.Location;
import android.location.LocationListener;
import android.location.LocationManager;
+import android.os.Bundle;
+import android.webkit.JavascriptInterface;
import android.webkit.WebView;
import org.json.JSONException;
import org.json.JSONObject;
@@ -29,6 +31,7 @@
private WebView browser;
private LocationManager myLocationManager=null;
+ @SuppressLint("SetJavaScriptEnabled")
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
@@ -83,6 +86,7 @@ public void onStatusChanged(String provider, int status,
};
public class Locater {
+ @JavascriptInterface
public String getLocation() throws JSONException {
Location loc=myLocationManager.getLastKnownLocation(PROVIDER);

0 comments on commit 4d16b19

Please sign in to comment.