为什么自制软件时一添加webview就闪退,没任何错误提示
aide吧
全部回复
仅看楼主
level 12
[泪]还有添加联网权限后为何安卓显示还是没有联网权限,急
2016年01月13日 13点01分 1
level 12
我把webview控件一删又没事。。。
2016年01月13日 13点01分 2
level 12
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.mycompany.rustedwarfarebox" >
<application
android:allowBackup="true"
android:icon="@drawable/icon"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name=".MainActivity"
android:launchMode="singleInstance"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".bingzhong"></activity>
<activity android:name=".lianji"></activity>
<activity android:name=".web"></activity>
</application>
<uses-permission android:name="android.permission.INTERNET"/>
</manifest>
权限添加哪里不对么
2016年01月13日 13点01分 3
level 12
01-13 21:19:51.352 16819 16848 E GED com.mycompany.rustedwarfarebox Failed to get GED Log Buf, err(0)
01-13 21:19:52.956 16819 16819 E AndroidRuntime com.mycompany.rustedwarfarebox FATAL EXCEPTION: main
01-13 21:19:52.956 16819 16819 E AndroidRuntime com.mycompany.rustedwarfarebox Process: com.mycompany.rustedwarfarebox, PID: 16819
01-13 21:19:52.956 16819 16819 E AndroidRuntime com.mycompany.rustedwarfarebox java.lang.RuntimeException: Unable to start activity ComponentInfo{com.mycompany.rustedwarfarebox/com.mycompany.rustedwarfarebox.web}: android.view.InflateException: Binary XML file line #69: Error inflating class Webview
2016年01月13日 13点01分 5
logcat 错误报告,怎么解决这个问题,求助
2016年01月13日 13点01分
level 12
你自己看XML文件的69行是什么问题
2016年01月13日 13点01分 6
谢谢
2016年01月13日 14点01分
原来是打代码的时候出错了
2016年01月13日 15点01分
level 13
改为android.webkit.WebView
2016年01月13日 13点01分 7
谢谢大神
2016年01月13日 14点01分
level 11
WebView中的v是小写?
2016年01月13日 13点01分 8
WebView要写准确地址,不然找不到
2016年01月13日 13点01分
是的,已解决,谢谢
2016年01月13日 14点01分
@浪漫魂魄º 大神怎么解决的,我在自己写的小demo中添加了webview之后apk安装到手机直接闪退,控制台不报任何错误
2017年06月22日 14点06分
@情203 http://www.cnblogs.com/phonegap/archive/2012/06/04/2536051.html参照这个博客的方法做的,webview是在按钮点击时触发,控件写在xml里,apk一运行立即闪退,不报任何错误,测试机同样是7.0
2017年06月22日 14点06分
level 6
记得要给WebView添加Layout_hight和Layout_width!
我查看了Logcat之后发现是没有给WebView添加高度,所以造成了闪退。
附上修正后的WebView的布局:
<WebView
android:layout_width="match_parent"
android:id="@+id/mainWebView1"
android:layout_height="match_parent"/>
附上我全部的xml:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<EditText
android:layout_width="wrap_content"
android:ems="10"
android:layout_height="wrap_content"
android:id="@+id/mainEditText1"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="JUMP"
android:id="@+id/mainButton1"/>
</LinearLayout>
<WebView
android:layout_width="match_parent"
android:id="@+id/mainWebView1"
android:layout_height="match_parent"/>
</LinearLayout>
2018年11月09日 02点11分 9
你们闪退不一定是这种原因,记得看Logcat!
2018年11月09日 02点11分
1