編輯:關於Android編程
#############################################
本文為極度寒冰原創,轉載請注明出處 #############################################diff --git a/src/com/android/browser/NavigationBarBase.java b/src/com/android/browser/NavigationBarBase.java
index daeb1de..6bec737 100644
--- a/src/com/android/browser/NavigationBarBase.java
+++ b/src/com/android/browser/NavigationBarBase.java
@@ -172,12 +172,13 @@ public class NavigationBarBase extends LinearLayout implements
boolean wap2estore = SystemProperties.getBoolean(
"persist.env.browser.wap2estore", false);
if ((wap2estore && isEstoreTypeUrl(text))
+ || isWtaiTypeUrl(text)) {
url = text;
} else {
url = UrlUtils.smartUrlFilter(text, false);
}
-
Tab t = mBaseUi.getActiveTab();
// Only shortcut javascript URIs for now, as there is special
// logic in UrlHandler for other schemas
@@ -199,7 +200,19 @@ public class NavigationBarBase extends LinearLayout implements
return;
}
}
+ Log.e(TAG,"bar url = " + url);
+ if (url != null && t != null && isWtaiTypeUrl(url))
+ {
+ if(handleWtaiTypeUrl(url))
+ {
+ return;
+ }
+ }
}
+
Intent i = new Intent();
String action = Intent.ACTION_SEARCH;
i.setAction(action);
@@ -256,6 +269,21 @@ public class NavigationBarBase extends LinearLayout implements
}
}
+ private boolean isWtaiTypeUrl(String url) {
+ String utf8Url = null;
+ try {
+ utf8Url = new String(url.getBytes("UTF-8"), "UTF-8");
+ } catch (UnsupportedEncodingException e) {
+ Log.e(TAG, "err " + e);
+ }
+ if (utf8Url != null && utf8Url.startsWith("wtai://wp/mc;")) {
+ return true;
+ }
+ return false;
+ }
+
String utf8Url = null;
try {
@@ -269,6 +297,21 @@ public class NavigationBarBase extends LinearLayout implements
return false;
}
+ private boolean handleWtaiTypeUrl(String url) {
+ Intent intent;
+ // perform generic parsing of the URI to turn it into an Intent.
+ intent = new Intent(Intent.ACTION_VIEW, Uri.parse(WebView.SCHEME_TEL + url.substring(("wtai://wp/mc;").length())));
+ try {
+ mContext.startActivity(intent);
+ } catch (ActivityNotFoundException ex) {
+ Log.w("Browser", "No resolveActivity " + url);
+ return false;
+ }
+ return true;
+ }
+
private boolean handleRtspTypeUrl(String url) {
Intent intent;
// perform generic parsing of the URI to turn it into an Intent.
Android下拉刷新上拉加載更多的擴展ListView
下拉刷新上拉加載更多的擴展ListView在很多APP我們都能看到,在一個列表上面,將手指往屏幕下面滑動,列表上方就會出現一個隱藏的View,一般寫有“下拉刷
[Android 測試] 性能回歸測試之 MonkeyRunner使用、插件擴展、結合批處理
一、 MonkeyRunner簡介monkeyrunner也是一款安卓sdk自有的測試工具,開源,位於\sdk\tools下面,它主要做性能測試,回歸測試,並且可以自定義
Android基礎入門教程——10.7 WindowManager(窗口管理服務)
Android基礎入門教程——10.7 WindowManager(窗口管理服務)標簽(空格分隔): Android基礎入門教程本節引言: 本節給
Android中Fragment管理及重疊問題的解決方法
一、Fragment介紹fragment在3.0被引入以後,項目使用fragment越來越多,特別是主界面是底部tab頁點擊切換更換內容,當然啦, Fragment 在項