Last active
January 26, 2018 18:31
-
-
Save SushmaBaliza/79762c78cfb029b791500eb772a68912 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.databinding.DataBindingUtil | |
import android.support.v7.app.AppCompatActivity | |
import android.os.Bundle | |
import com.processmap.databindingexample.databinding.ActivityMainBinding | |
class MainActivity : AppCompatActivity() { | |
private var mBinding: ActivityMainBinding? = null //This ActivityMainBinding class is auto generated by data binding library for us | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
mBinding=DataBindingUtil.setContentView(this,R.layout.activity_main) //Setting contentview usind data binding. | |
mBinding?.txtView?.setText("Hello!") //Accessing textview using mbinding | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment