Creating a new Kotlin Activity
suggest change- Click to
File
→New
→Kotlin Activity
. - Choose a type of the Activity.
- Select name and other parameter for the Activity.
- Finish.
Final class could look like this:
import android.support.v7.app.AppCompatActivity
import android.os.Bundle
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
}
}
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents