Kotlin Class「T」

        fun  gotoMainPage(
            context: Activity,
            postId: String,
            mainActivity: Class
        ) {
            val intent = Intent(context, ADSplashActivity::class.java)
            intent.putExtra("postId", postId)
            intent.putExtra("mainActivity", mainActivity)
            context.startActivity(intent)
            // 修复 Android 9.0 下 Activity 跳转动画导致的启动页闪屏的问题
            context.overridePendingTransition(0, 0)
            context.finish()
        }
 var activity=MainActivity1::class.java;
        AnguoAds.gotoMainPage(this, "132", activity)

 

你可能感兴趣的:(#,Kotlin)