From c75e66a2fcaa998e75cdcf085e05ed28e1d6f5d7 Mon Sep 17 00:00:00 2001 From: Joe Bowser Date: Tue, 6 Jul 2010 11:43:25 -0700 Subject: [PATCH] Removing the GapViewClient handler, since it breaks PhoneGap, reverting. Rather have every other URI working except for sms: --- framework/src/com/phonegap/DroidGap.java | 61 +----------------------- 1 file changed, 1 insertion(+), 60 deletions(-) diff --git a/framework/src/com/phonegap/DroidGap.java b/framework/src/com/phonegap/DroidGap.java index 051d467b..1f505a43 100644 --- a/framework/src/com/phonegap/DroidGap.java +++ b/framework/src/com/phonegap/DroidGap.java @@ -105,9 +105,7 @@ public class DroidGap extends Activity { { appView.setWebChromeClient(new GapClient(this)); } - - appView.setWebViewClient(new GapViewClient(this)); - + appView.setInitialScale(100); appView.setVerticalScrollBarEnabled(false); @@ -181,63 +179,6 @@ public class DroidGap extends Activity { { appView.loadUrl(url); } - - public class GapViewClient extends WebViewClient { - - Context mCtx; - - public GapViewClient(Context ctx) - { - mCtx = ctx; - } - - /* - * (non-Javadoc) - * @see android.webkit.WebViewClient#shouldOverrideUrlLoading(android.webkit.WebView, java.lang.String) - * - * Note: Since we override it to make sure that we are using PhoneGap and not some other bullshit - * viewer that may or may not exist, we need to make sure that http:// and tel:// still work. - * - */ - - @Override - public boolean shouldOverrideUrlLoading(WebView view, String url) { - // TODO: See about using a switch statement - if (url.startsWith("http://")) - { - Intent browse = new Intent(Intent.ACTION_VIEW, Uri.parse(url)); - startActivity(browse); - return true; - } - else if(url.startsWith("tel://")) - { - Intent dial = new Intent(Intent.ACTION_DIAL, Uri.parse(url)); - startActivity(dial); - return true; - } - else if(url.startsWith("sms:")) - { - Uri smsUri = Uri.parse(url); - Intent intent = new Intent(Intent.ACTION_VIEW, smsUri); - intent.setType("vnd.android-dir/mms-sms"); - startActivity(intent); - return true; - } - else if(url.startsWith("mailto:")) - { - Intent mail = new Intent(Intent.ACTION_SENDTO, Uri.parse(url)); - startActivity(mail); - return true; - } - else - { - //We clear the back button state - mKey.reset(); - view.loadUrl(url); - return false; - } - } - } /**