当前位置:网站首页>WebView error
WebView error
2022-06-22 03:52:00 【One stop to s】
WebView.destroy() called while WebView is still attached to window.
resolvent :
Now sum up the solution to this problem . First, explain the mistake roughly , This mistake literally means when you end up webview When ,Webview Also attached to the parent control , Use to solve this problem
Is in the WebView.destroy() We should remove the attachment between them . This problem usually happens. It should be like this webview It's operated :
protected void onDestroy()
{
if (adView != null)
{
adView.destroy();
}
}
Attach a detailed correct code :
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/webviewRelativeLayout"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<WebView
android:id="@+id/webView1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/headerAlarmsWebViewTxt"
android:layout_marginBottom="0dip"
android:hapticFeedbackEnabled="true"
android:overScrollMode="never"
android:scrollbarAlwaysDrawVerticalTrack="false"
android:scrollbars="none" />
</RelativeLayout>
Then you assign it to an instance variable e.g. :
_layout = (RelativeLayout) findViewById(R.id.webviewRelativeLayout);
webView = (WebView) findViewById(R.id.webView1);
and on Destroy do something like this:
@Override
protected void onDestroy() {
super.onDestroy();
_layout.removeView(webView);
webView.removeAllViews();
webView.destroy();
}
Generally, you can understand the problem after reading this code .
Reprinted address :
边栏推荐
- Application method and operation of Beifu cx9020 (wince 7) controller
- How to break through the sales dilemma of clothing stores
- 快速掌握 ASP.NET 身份认证框架 Identity - 用户注册
- Mysql 45讲学习笔记(一)一条sql语句的执行
- 微信小程序 上传七牛云 laravel
- How to realize SVN efficient management
- Introduction to Beifu TwinCAT NC PTP
- Key program of TwinCAT 3 RS232 communication
- Hierarchical traversal of binary tree
- ES next 新特性
猜你喜欢

The "two lives" I spent in Huawei (learning from those who performed well in large factories)

八大排序之直接插入排序

The future has come: cloud primary Era

倍福TwinCAT3控制器和控制器间的Ads通讯

Wireshark数据包分析——wireshark0051.pcap

我在华为度过的 “两辈子”(学习那些在大厂表现优秀的人)

Analyzing iceberg merge tasks to resolve data conflicts

Tried several report tools, and finally found a report based on Net 6

Mysql 45讲学习笔记(二)SQL更新语句的执行

Fluent rendering Principle & detailed explanation of three trees
随机推荐
MySQL 45 lecture learning notes (IV) index
LeetCode --- 1221. Split a string in balanced strings problem solving Report
Fatal NI connect error 12170.报错处理
[netding Cup 2018] fakebook1 reference
Hierarchical traversal of binary tree
Shutter status management
128陷阱——源码分析
[leetcode] 17 backtracking (letter combination of telephone number)
C # custom sorting
存算一体芯片离普及还有多远?听听从业者怎么说 | 对撞派 x 后摩智能
【第23天】给定一个长度为 n 的数组,返回删除第 X 位元素后的数组 | 数组删除操作
A solution to the conflict between the keywords of DM data and the fields of the table
Interviewer: do you know the life cycle of flutter?
svn与cvs的区别有哪些
面试官:知道 Flutter 生命周期吗?
Beifu twincat3 third-party servo motor -- Taking Huichuan is620n servo as an example
L'avenir est venu: l'âge du nuage
Flyter color gradient and follow button imitating Taobao gradient
Pan micro e-cology V9 information disclosure vulnerability
How to synchronize the oak camera?