【发布时间】:2016-03-26 05:42:56
【问题描述】:
在实施 WebView 客户端后,我的应用程序在运行应用程序后不断收到“不幸的是,“我的应用程序”已停止”。 这是我的清单
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="amapps.com.uhss" >
<uses-permission android:name="android.permission.INTERNET"/>
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="UHS Sword And Shield"
android:theme="@style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="UHS Sword and Shield" >
android:hardwareAccelerated="false"
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
如你所见,我已经实现了互联网权限
import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
public class MainActivity extends Activity {
private WebView mWebView = (WebView) findViewById(R.id.activity_main_webview);
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(amapps.com.uhss.R.layout.activity_main);
WebView mWebView = (WebView) findViewById(R.id.activity_main_webview);
mWebView.setWebViewClient(new WebViewClient());
WebSettings webSettings = mWebView.getSettings();
webSettings.setJavaScriptEnabled(false);
mWebView.loadUrl("http://uhsswordandshield.com/");
mWebView.getSettings().setSupportMultipleWindows(true);
}
那么有人可以告诉我我的清单或主要活动有什么问题吗? 在我将 WebView 客户端实施到我的应用程序中以处理我的应用程序中的打开链接之前,我的应用程序正在运行。谢谢!
【问题讨论】:
-
为什么你做 findview 两次粘贴错误日志并删除私有 Webview ....?
-
请将有用的答案标记为答案。
-
哦,好吧,对不起,新堆栈
标签: java android android-studio webview webviewclient