Issue
I have a kotlin activity used as splashscreen to check if the user is already logged in using Google services or not. After awaiting 600ms it should create an intent to redirect the user on the LoginActivity or MainActivity using the ActiviyClass::class.java
For some reason Android studio marks "java" in red and tells "Unresolved reference: java", where did i mess up?
Code:
var intent = Intent(this, MainActivity::class.java)
if(!isLoggedIn()){
intent = Intent(this, LoginActivity::class.java)
}
Solution
Mostly these type of issues are related to tool that you are using i.e Android studio. I have copied your code and pasted in my project and its working perfect.
Please look screen shot attached.
Possible solution :
1- Try invalidate cache and restart your Android studio. I am attaching screen shot of place where you can find this option.
Happy coding!!
Answered By - Zaeem Sattar
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.