Question: Hello, am getting a error in this line val intent = Intent(this, Homescreen::class.java) The error that is occurring is: None of the following functions can

Hello, am getting a error in this line "val intent = Intent(this, Homescreen::class.java)" The error that is occurring is: None of the following functions can be called with the arguments supplied. (Context!, Class<*>!) defined in android.content.Intent (String!, Uri!) defined in android.content.Intent  I have been struggling to solve problem for a while, can anyone give me a hand? I am new to android development :) Thanks in advance! private fun readData() { val username = binding.edtEmail.text.toString() val pass = binding.edtPassword.text.toString() if(username.isNotBlank() && pass.isNotBlank()) { lifecycleScope.launch { try { val user = UserRepository.acceptUser(username, pass) Toast.makeText(this@Signin, "Welcome", Toast. LENGTH_SHORT).show() val intent = Intent(this, Homescreen::class.java) startActivity(intent) } catch (e: Exception) { Toast.makeText(this@Signin, "Wrong, try again", Toast. LENGTH_SHORT).show() } } } else { Toast.makeText(this@Signin, "Wrong, try again", Toast.LENGTH_SHORT).show() } }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!