Android片段代码

2017-09-28  本文已影响10人  Jaesoon

判断应用是否在调试状态运行

private boolean isDebugVersion(Context context) {
        try {
            ApplicationInfo info = context.getApplicationInfo();
            return (info.flags & ApplicationInfo.FLAG_DEBUGGABLE) != 0;
        } catch (Exception e) {
            e.printStackTrace();
        }
        return false;
}

设置Webview userAgent

WebSettings settings = webview.getSettings(); 
settings .setUserAgentString("softbank"); 
上一篇下一篇

猜你喜欢

热点阅读