【发布时间】:2020-11-26 06:55:18
【问题描述】:
我最近下载了适用于 Windows 10 的 Android Studio,这是我的第一个项目,IDE 工作正常,但是当我测试它时,它会出现如图所示的错误
这里是java代码。
package pro.haha_yes_appss.goproooooooooooooooooooooooo;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.webkit.WebViewClient;
public class youtube extends AppCompatActivity {
private WebView webView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_youtube);
webView = (WebView) findViewById(R.id.webview);
webView.setWebViewClient(new WebViewClient())
webView.loadurl("https://www.youtube.com/c/TuckerBudzyn/featured")
}
}
如果它必须对我的 xml 样式文件做任何事情,那么就是这里
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/webview"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="https://www.youtube.com/c/TuckerBudzyn/featured">
<WebView
android:layout_width="match_parent"
android:layout_height="match_parent" />
</RelativeLayout>
<WebView
android:id="@/id+webview"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</RelativeLayout>
ps 我正在学习一个教程,这里是它的链接
【问题讨论】:
-
如果这有什么不同的话,我的应用也会使用互联网
-
你能出示你的清单吗?
-
webView的id应该是:android:id="@+id/webview"
标签: java android xml android-studio