title: How do I open another activity and change the URL of the web view located in that activity
body: <p>How do I open another activity and change the URL of the web view located in that activity ? My current code keeps crashing. I can get it to work if i put a webview in main. The issue seems to be because its in another activity.</p>
  <pre><code>class MainActivity : AppCompatActivity() {
  private val webView: WebView? = null
  override fun onCreate(savedInstanceState: Bundle?) {
      super.onCreate(savedInstanceState)
      setContentView(R.layout.activity_main)
      val itemAdapter = ItemAdapter(this, title(), date(), cat(),picture(),url())
      getTopStories()
      val mbtnTopStories = findViewById(R.id.btnTopStories) as Button
      val mbtnMostPopular = findViewById(R.id.btnMostPopular) as Button
      val mbtnArts = findViewById(R.id.btnArts) as Button
  
      mbtnTopStories.setOnClickListener {
          itemAdapter.deleteItems()
          getTopStories()
      }
  
      mbtnMostPopular.setOnClickListener {
          itemAdapter.deleteItems()
          getMostPopular()
      }
  
      mbtnArts.setOnClickListener {
  
          val intent = Intent(this, com.example.newsapp.WebView::class.java)
          this.startActivity(intent)
          val myWebView = WebView()
          WebView().webViewArticle.loadUrl(&quot;http://www.google.com&quot;)
          val webView = findViewById&lt;WebView&gt;(R.id.webViewArticle)
          webView.webViewClient = WebViewClient()
          webView.loadUrl(&quot;https://www.google.com&quot;)
          val webSettings = webView.settings
          webSettings.javaScriptEnabled = true
      }
  </code></pre>
  <p>This is my error log</p>
  <pre><code>2021-07-17 19:20:46.243 4231-4231/com.example.newsapp E/AndroidRuntime: FATAL EXCEPTION: main
  Process: com.example.newsapp, PID: 4231
  java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.pm.ApplicationInfo android.content.Context.getApplicationInfo()' on a null object reference
      at android.content.ContextWrapper.getApplicationInfo(ContextWrapper.java:152)
      at android.view.ContextThemeWrapper.getTheme(ContextThemeWrapper.java:157)
      at android.content.Context.obtainStyledAttributes(Context.java:655)
      at androidx.appcompat.app.AppCompatDelegateImpl.createSubDecor(AppCompatDelegateImpl.java:842)
      at androidx.appcompat.app.AppCompatDelegateImpl.ensureSubDecor(AppCompatDelegateImpl.java:809)
      at androidx.appcompat.app.AppCompatDelegateImpl.findViewById(AppCompatDelegateImpl.java:633)
      at androidx.appcompat.app.AppCompatActivity.findViewById(AppCompatActivity.java:259)
      at com.example.newsapp.MainActivity$onCreate$3.onClick(MainActivity.kt:84)
      at android.view.View.performClick(View.java:6294)
      at android.view.View$PerformClick.run(View.java:24770)
      at android.os.Handler.handleCallback(Handler.java:790)
      at android.os.Handler.dispatchMessage(Handler.java:99)
      at android.os.Looper.loop(Looper.java:164)
      at android.app.ActivityThread.main(ActivityThread.java:6494)
      at java.lang.reflect.Method.invoke(Native Method)
      at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
  </code></pre>