简体   繁体   English

Kotlin和Android配置调试

[英]Kotlin and Android configuration Debug

I just downloaded Android Studio and Java JDK. 我刚刚下载了Android Studio和Java JDK。 So, when I create My Application and it launches file such as MainActivity.kt and instead I want to use /java and I am not sure how to fix this. 因此,当我创建“我的应用程序”并启动诸如MainActivity.kt之类的文件时,我想使用/ java,但不确定如何解决此问题。

Well first, you should create a MainActivity.java class like normal, and in your manifest where your MainActivity.kt is being used replace it with you MainActivity.java. 首先,您应该像正常创建一个MainActivity.java类,并在使用MainActivity.kt的清单中将其替换为MainActivity.java。 That should launch your java activity as opposed to the Kotlin one. 那应该启动您的Java活动,而不是Kotlin活动。

While you are creating a new project you should mark the "Include Kotlin support" checkbox on page. 创建新项目时,应在页面上选中“包括Kotlin支持”复选框。 So the kotlin dependencies won't be added to your project. 因此,不会将kotlin依赖项添加到您的项目中。

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM