• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

webView

testDev

Lurker
Hello Folks,

trying to get the webView working , dose not seem to work for some reason,
have imported the webkit.WebView as well ? any help would be of great help
this is the code below

Code:
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.webkit.WebView;

public class MainActivity extends AppCompatActivity {
    private WebView createdWebView;

    [USER=1021285]@override[/USER]
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        createdWebView = (WebView)findViewById(R.id.webView);->gives me error
     
    }
}

error: cannot find symbol
createdWebView = (WebView)findViewById(R.id.webView);
^
symbol: variable webView
location: class id

Thanks
 
Last edited by a moderator:
I moved this to the dev area to get better help. I also put code tags in for readability. Good luck!! :)
Code Tag Usage:

[code]Line 1
Line 2
Line 3
Maintains white space
Doesn't turn :) into emoji
etc...
[/code]


Code:
Line 1
Line 2
Line 3
        Maintains white space
        Doesn't turn :) into emoji
etc...
 
Back
Top Bottom