https://kotlinlang.org logo
#android
Title
# android
r

r-z

05/19/2017, 6:11 PM
Ayy wadaap, tying out android development with kotlin and can't figure out of how to open new activities. I'm guessing it's the same as it is with java, so create new intent, start intent
i

inv3rse

05/19/2017, 6:14 PM
r-z: Yes, however using the anko library you can simplify that to
Copy code
startActivity<SomeOtherActivity>("id" to 5)
https://github.com/Kotlin/anko/wiki/Anko-Commons-%E2%80%93-Intents
r

r-z

05/19/2017, 6:20 PM
Getting a really long error message if anko is installed. Messes up my android studio, installing a few updates and checking if that helps.
Cannot load project: com.intellij.ide.plugins.PluginManager$StartupAbortedException: com.intellij.diagnostic.PluginException: org/jetbrains/android/uipreview/AndroidLayoutPreviewToolWindowManager [Plugin: org.jetbrains.kotlin.android.dsl] So that's the message, any ideas what to do?
Does anyone know how to deal anko android studio error?
i

inv3rse

05/19/2017, 6:52 PM
Try adding just
Copy code
compile 'org.jetbrains.anko:anko-common:0.9.1a'
I am assuming that it is the optional dsl part of anko that is making problems for you
r

r-z

05/19/2017, 7:00 PM
Ah, I tried installing the plugin via sdk manager. This gradle build line seems like to be enough for it to work. Thanks a lot
r

ra1nmak3r

05/19/2017, 7:18 PM
it's just....
startActivity(Intent(this, ScreenResult::class.java))