- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
您好,我有一个非常基本的 Titanium 应用程序。有 3 个 Web View 。当一开始就有 wifi 时,所有三个 WebView 都可以正常加载。我检查了我的代码,其中只有在有互联网连接时才添加 webview。如果没有,我会添加一个说明连接到互联网的标签和一个刷新按钮。当我单击刷新按钮时,Web View 的添加使应用程序崩溃。代码适用于 iOS,不适用于 Android。使用 SDK 3.2.3。代码如下:
refresh.addEventListener("click", function (e){
if(Ti.Network.online){
console.log(" here 1 -----------");
Navbar.remove(refresh);
console.log(" here 2 -----------");
self.remove(NoInternet_view);
console.log(" here 3 -----------");
self.add(shopWebView);
console.log(" here 4 -----------");
}
else{
alert("An internet connection is required");
}
});
日志打印输出“here 3 ----------”然后崩溃。
相关日志:
F/libc (12588): Fatal signal 11 (SIGSEGV) at 0x0000000c (code=1), thread 12612 (KrollRuntimeThr)
[INFO][DEBUG ( 1764)] *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
[INFO][DEBUG ( 1764)] Build fingerprint: 'samsung/lt01wifixx/lt01wifi:4.2.2/JDQ39/T310XXUAMF1:user/release-keys'
[INFO][DEBUG ( 1764)] Revision: '6'
[INFO][DEBUG ( 1764)] pid: 12588, tid: 12612, name: KrollRuntimeThr >>> com.girt.cuddles <<<
[INFO][DEBUG ( 1764)] signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0000000c
[INFO][DEBUG ( 1764)] r0 00000000 r1 5e93c4e8 r2 000000aa r3 00000001
[INFO][DEBUG ( 1764)] r4 00000000 r5 5a386ec8 r6 5e49f9bc r7 00000000
[INFO][DEBUG ( 1764)] r8 5e49f88f r9 5e49f870 sl 5e49f9bc fp 5eb506a5
[INFO][DEBUG ( 1764)] ip 5ea062f8 sp 5e49f818 lr 5e518473 pc 5e518284 cpsr 40000030
[INFO][DEBUG ( 1764)] d0 0000000000000000 d1 4018000000000000
[INFO][DEBUG ( 1764)] d2 0000000000000000 d3 000f4240003d0900
[INFO][DEBUG ( 1764)] d4 0000000000000001 d5 3ff0000000000000
[INFO][DEBUG ( 1764)] d6 0000860100000000 d7 0000860100000000
[INFO][DEBUG ( 1764)] d8 0000000000000000 d9 0000000000000000
[INFO][DEBUG ( 1764)] d10 0000000000000000 d11 0000000000000000
[INFO][DEBUG ( 1764)] d12 0000000000000000 d13 0000000000000000
[INFO][DEBUG ( 1764)] d14 0000000000000000 d15 0000000000000000
[INFO][DEBUG ( 1764)] d16 0000000000000001 d17 0000000000000000
[INFO][DEBUG ( 1764)] d18 0000000000004001 d19 0000000000000000
[INFO][DEBUG ( 1764)] d20 3fc554e7eb0eb47c d21 3e66376972bea4d0
[INFO][DEBUG ( 1764)] d22 3f4de16b9c24a98f d23 3fb0f4a31edab38b
[INFO][DEBUG ( 1764)] d24 3fede16b9c24a98f d25 3fe55559ee5e69f9
[INFO][DEBUG ( 1764)] d26 0000000000000000 d27 0000000000000000
[INFO][DEBUG ( 1764)] d28 0000000000000000 d29 0000000000000000
[INFO][DEBUG ( 1764)] d30 0000000000000000 d31 0000000000000000
[INFO][DEBUG ( 1764)] scr 60000013
[INFO][DEBUG ( 1764)]
[INFO][DEBUG ( 1764)] backtrace:
[INFO][DEBUG ( 1764)] #00 pc 00078284 /data/app-lib/com.girt.cuddles-1/libkroll-v8.so (titanium::EventEmitter::~EventEmitter()+71)
[INFO][DEBUG ( 1764)] #01 pc 0007846f /data/app-lib/com.girt.cuddles-1/libkroll-v8.so (titanium::JavaObject::getJavaObject()+58)
[INFO][DEBUG ( 1764)] #02 pc 0007e157 /data/app-lib/com.girt.cuddles-1/libkroll-v8.so (titanium::TypeConverter::jsValueToJavaObject(_JNIEnv*, v8::Local<v8::Value>, bool*)+302)
[INFO][DEBUG ( 1764)] #03 pc 0009a2f9 /data/app-lib/com.girt.cuddles-1/libkroll-v8.so (titanium::TiViewProxy::add(v8::Arguments const&)+332)
[INFO][DEBUG ( 1764)] #04 pc 00171034 /data/app-lib/com.girt.cuddles-1/libkroll-v8.so
[INFO][DEBUG ( 1764)] #05 pc 00067c00 <unknown>
[INFO][DEBUG ( 1764)]
[INFO][DEBUG ( 1764)] stack:
[INFO][DEBUG ( 1764)] 5e49f7d8 40043d5c
[INFO][DEBUG ( 1764)] 5e49f7f4 4094f6e4 /system/lib/libdvm.so
[INFO][DEBUG ( 1764)] 5e49f7f8 00000000
[INFO][DEBUG ( 1764)] 5e49f7fc 59f04dc8
[INFO][DEBUG ( 1764)] 5e49f800 409d1c98 /system/lib/libdvm.so
[INFO][DEBUG ( 1764)] 5e49f804 57225378 /dev/ashmem/dalvik-LinearAlloc (deleted)
[INFO][DEBUG ( 1764)] #00 5e49f818 5ea06218 /data/app-lib/com.girt.cuddles-1/libkroll-v8.so
[INFO][DEBUG ( 1764)] ........ ........
[INFO][BootReceiver( 2125)] Copying /data/tombstones/tombstone_05 to DropBox (SYSTEM_TOMBSTONE)
[INFO][dumpstate(13169)] begin
[WARN][ContextImpl( 2125)] Calling a method in the system process without a qualified user: android.app.ContextImpl.sendBroadcast:1346 com.android.server.analytics.data.collection.application.CrashAnrDetector.broadcastEvent:291 com.android.server.analytics.data.collection.application.CrashAnrDetector.processDropBoxEntry:254 com.android.server.analytics.data.collection.application.CrashAnrDetector.access$100:60 com.android.server.analytics.data.collection.application.CrashAnrDetector$1.onReceive:102
[INFO][Monitor ( 2125)] SIOP:: Current AP = 360, CP = 0
[INFO][dumpstate(13169)] done
[INFO][SurfaceFlinger( 1771)] id=71 Removed UiActivity (2/4)
[INFO][ActivityManager( 2125)] Process com.girt.cuddles (pid 12588) (adj 0) has died.
[WARN][InputDispatcher( 2125)] channel ~ Consumer closed input channel or an error occurred. events=0x9
[ERROR][InputDispatcher( 2125)] channel ~ Channel is unrecoverably broken and will be disposed!
编辑:与 map 页面关联的代码:
var removeRefresh = function removeRefresh() {
if(Ti.Network.getOnline()) {
console.log("issue 1-------");
self.remove(NoInternet_view);
console.log("issue 2-------");
self.add(map1);
console.log("issue 3-------");
Navbar.remove(refresh);
console.log("issue 4-------");
}
else alert("An internet connection is required");
};
refresh.addEventListener("click", removeRefresh);
最佳答案
您正在销毁匿名处理程序中的刷新 (Ti.UI.Button)。
你可以试试这段代码:
var removeRefresh = function removeRefresh() {
if(Ti.Network.getOnline()) {
Ti.API.info(" Checkpoint 1 -----------");
self.remove(NoInternet_view);
Ti.API.info(" Checkpoint 2 -----------");
self.add(shopWebView);
Ti.API.info(" Checkpoint 3 -----------");
Navbar.remove(refresh);
Ti.API.info(" Checkpoint 4 -----------");
}
else alert("An internet connection is required");
};
refresh.addEventListener("click", removeRefresh);
您必须确保现有的 NoInternet_view 和 shopWebView。
Titanium Studio 控制台将显示四个消息 (Ti.API.info)
关于javascript - WebView 导致应用程序崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25063206/
Webview shouldInterceptRequest方法总是返回null。我去了adblocking的use方法。我尝试了很多adblock方法,但是总是需要这个shouldIntercept
在我的 Native React 项目中,我想使用 WebView。 HTML是指外部的css文件,css文件是指一些自定义字体。 鉴于此层次结构: app/ app/index.ios.js app
我在一个页面上有多个 webview,当应用程序加载时,主页面卡住了将近 8-10 秒,我猜测这是所有 webview 加载各自网站所花费的时间,为什么 Ui 卡住了,我怎么能使 webview 加载
nativescript 中的 webview 是否有“导航”事件? 我已经在 Xamarin (c#) 中用 完成了 Browser.Navigating += Myfunction natives
我的浏览器 (webview) 以 HTML 页面开头 FILEJAVA.class.getResource ("FILEHTML.html")。 ToExternalForm () 每当我访问谷歌时
我们正在开发一个 JavaFX 2.x 应用程序,它需要提供一些 GIS 支持。我们得出的结论是,通过嵌入式 WebView 使用 GoogleMaps 是最快的选择。它的问题在于每次我们的应用程序启
有没有办法销毁 WebView 实例?如果页面加载,并说视频开始播放,我希望能够,当我隐藏 WebView 时,基本上可以销毁它,或者至少重置它。 我知道我可以听 visibleProperty 并执
有没有办法在不启用远程模块的情况下在 webview 和主窗口之间进行通信? When this attribute is false the guest page in webview will
我使用以下代码来拦截Web View 中的对话框,但看不到内容或无法与之交互: Element webview= querySelector("#webview"); Map map=new
我正在创建一个页面,该页面将在 Java 的 WebView 中打开,或在外部浏览器中手动打开。如果页面是从 Java 加载的——我需要它来执行特定的回调,因为 Java 被用作一种后端,但如果页面是
我有一个 React Native WebView ,它运行一个小的 HTML 文档。该文档显示了一些图像。 我希望显示位于应用程序的 Documents 文件夹中的图像,即图像不是静态 Assets
我正在使用 JavaFX webview 开发一个网络爬虫。出于抓取目的,我不需要加载图像。当页面被加载时,Webkit 会产生很多 UrlLoader 线程。所以我认为最好禁用图像,这样我会节省很多
这个问题在这里已经有了答案: Android webview launches browser when calling loadurl (11 个答案) 关闭 7 年前。 我花了两天的时间来寻找一
我正在加载一个网页,我想使用基本身份验证登录,我有使用 Swift 的经验并且能够像下面那样执行基本身份验证,但我无法为我的应用程序的 Flutter 版本实现基本身份验证。 ---- swift 代
我用 webview 创建了应用程序,我想在 webview 中加载所有内部链接并在 android 浏览器中加载外部链接。现在的问题是我正在使用 html 广告,当我点击广告时我想打开外部浏览器,但
我需要在父背景图案上显示我的 webview 内容。有没有直接的方法来做到这一点? 最佳答案 这可能有用 final com.sun.webkit.WebPage webPage = com.sun.
是否可以从 webview 中加载的页面读取 http 请求和响应数据。我想要做的是在用户单击 webview 中页面内的链接后从响应中获取二进制数据。任何帮助或线索将不胜感激 最佳答案 创建您自己的
我有一个简单的WebView在 Android 上运行 Web 应用程序。问题是当我旋转手机以将其更改为横向 webview重新加载并回到开头。 我怎样才能防止这种行为? 罗恩 最佳答案 从 Andr
我创建了一个带有 webview 标签的自定义浏览器。当我在 google.it(或 google.com)中导航时,有时会出现一条消息说 chrome 已过时。我的应用版本是: Node.js 8.
我正在使用 Electron 创建简单的网络浏览器。我的用例是我需要通过不同/各自的代理 IP 路由每个 URL。如果用户输入 google.com,则必须通过 123.123.122.1:8081
我是一名优秀的程序员,十分优秀!