Latest News

Change Actionbar Title Of An Activity Programmatically (Kotlin)- Android Studio

In this tutorial we will change the title of Actionbar of an Activity in Kotlin using Android Studio...

Step 1: Create a new Project OR Open you project

Step 2: Code

MainActivity.kt
package com.blogspot.atifsoftwares.kotlinpracticeimport android.support.v7.app.AppCompatActivityimport android.os.Bundleclass MainActivity : AppCompatActivity() {override fun onCreate(savedInstanceState: Bundle?) {super.onCreate(savedInstanceState)setContentView(R.layout.activity_main)//to change title of activityval actionBar = supportActionBaractionBar!!.title = "New Title"}}

Step 3: Output


0 Response to "Change Actionbar Title Of An Activity Programmatically (Kotlin)- Android Studio"