如何获得kotlin匿名类中的父类

我在kotlin的匿名类中创建Intent时遇到了麻烦。 我想在kotlin中重现下面的代码:

ModuleDAO.INSTANCE.refresh(new AnswerListener() { @Override public void onAnswerRetrieved() { final Intent intent = new Intent(SplashScreenActivity.this, MainActivity.class); startActivity(intent); finish(); } @Override public void onError(int error) { // doesn't matter } }); 

我尝试过,但不起作用:

 ModuleDAO.refresh(object : AnswerListener { override fun onAnswerRetrieved() { val intent = Intent(SplashScreenActivity::act, MainActivity::class.java) startActivity(intent) } override fun onError(error: Int) { // doesn't matter } }) 

Kotlin language will be the best programming language for Android.