diff --git a/framework/src/com/phonegap/DroidGap.java b/framework/src/com/phonegap/DroidGap.java index 4c8c3c81..6c46ac3b 100644 --- a/framework/src/com/phonegap/DroidGap.java +++ b/framework/src/com/phonegap/DroidGap.java @@ -182,14 +182,13 @@ public class DroidGap extends Activity { * @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. We - * plan to add sms:// and gap:// to make this more compatible with the iPhone, but for right now - * we're fixing what we're breaking. + * 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)); @@ -202,6 +201,14 @@ public class DroidGap extends Activity { 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 { view.loadUrl(url);