Reputation:
I recently downloaded Android studio for windows 10 and this was my first project the ide works fine but when i test it it gives this error shown in picture
Here is the java code.
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")
}
}
And if it has to do anything with my xml style file then here it is
<?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 i was following a tutorial here is its link
https://www.youtube.com/watch?v=TUXui5ItBkM
Upvotes: 1
Views: 108
Reputation: 1640
The id of the webview in your layout file should be in this format:
android:id="@+id/webview"
not
android:id="@/id+webview"
Upvotes: 2