title: Android Studio "Intent" not working even after importing "android.content.Intent"
body: <p>I am trying out a very simple intent example follow <a href="https://www.youtube.com/watch?v=fWpdsS5Jkvo" rel="nofollow noreferrer">this</a> youtube video. However, i facing a very weird error where this particular line cannot work:</p>
  <p><code> Intent myIntent = new Intent(this, DisplayActivity.class)</code></p>
  <p>It provide me error as shown in the picture:
  <a href="https://i.stack.imgur.com/keQ7D.png" rel="nofollow noreferrer">Error</a></p>
  <p>I also had tried out the &quot;bulb&quot; button in AS to debug it but it didn't show me a valid solution. The suggested action is as shown in the picture <a href="https://i.stack.imgur.com/mVVSJ.png" rel="nofollow noreferrer">Original AS code editor image</a></p>
  <p>The full code is shown below:</p>
  <pre><code>package com.example.parcelsort_ar
  
  import android.content.pm.PackageManager
  import androidx.appcompat.app.AppCompatActivity
  import android.os.Bundle
  import android.util.Log
  import android.view.View
  import android.widget.Button
  import android.widget.TextView
  import android.widget.Toast
  import androidx.core.app.ActivityCompat
  import androidx.core.content.ContextCompat
  import com.budiyev.android.codescanner.*
  import com.example.parcelsort_ar.databinding.ActivityMainBinding
  import android.content.Intent
  
  private const val CAMERA_REQUEST_CODE = 101
  
  class MainActivity : AppCompatActivity() {
      private lateinit var codeScanner: CodeScanner
      private lateinit var binding: ActivityMainBinding 
      val btn_click_me = findViewById(R.id.idBtnPost) as Button
  
          override fun onCreate(savedInstanceState: Bundle?) {
              super.onCreate(savedInstanceState)
  
              //View binding
              binding = ActivityMainBinding.inflate(layoutInflater)
              val view = binding.root
              setContentView(view)
  
              binding.idBtnPost.setOnClickListener {
                  openActivity2();
              }
  
    
              setupPermission()
              codeScanner()
      }
  
      public fun openActivity2() {
          Intent myIntent = new Intent(this, DisplayActivity.class);
          startActivity(intent);
      }
  }
  </code></pre>
  <p>I had spending almost a day searching online but couldn't found any issue that meet my problem. Any help is aprreciated.</p>