Back to Browse

5. WHAT IS MAINACTIVITY.JAVA | CHANGE TEXT-2 | ANDROID APP DEVELOPMENT

21.1K views
Feb 22, 2016
8:47

What is MainActivity.java| ChangeText -2 MainActvity.java is one of the most important file in Android Studio. It is inside this file you define methods, functions, datatypes and variables. To complete the ChangeText app that we created in the previous video lets first define two datatype mainly TextView and Button. The variable name for TextView is quote and that for Button is clk. After declaring the Button and TextView we need to initialize them, So we initialize the Button and TextView and store the id of textview and button in variables quote and clk So textview id is stored in quote. And button id is stored in clk. After the id’s are stored in variable we can then use then link the variables with respective methods. In this video you will also see what setonclicklistiner method is and how setonclicklistiner method can be linked with a particular variable We use the method changequote to check whether the button is clicked or not. If the button is clicked changequote method will be called and it will change the text inside TextView

Download

1 formats

Video Formats

360pmp412.5 MB

Right-click 'Download' and select 'Save Link As' if the file opens in a new tab.

5. WHAT IS MAINACTIVITY.JAVA | CHANGE TEXT-2 | ANDROID APP DEVELOPMENT | NatokHD