In this step we create a new project in android studio by filling all the necessary details of the app like app name, package name, api versions etc. In this example, we will declare three string variables using different methods and print them in an Android Toast using Toast.makeText () method. Step 6) Now add below code in MainActivity.java in onCreate() method- //- etMessage = (EditText) findViewById(R.id.et_message) btnSendData = (Button) findViewById(R.id.btn_send_data) tOnClickListener(new View. Step 1: Create a new project and name it CheckBoåxample. Step 5) Now add two variables in MainActivity.java- private EditText etMessage private Button btnSendData Your strings.xml file could look like this: Step 4) Type below code in activity_main.xml- Imagine we would have included the text for the toast being displayed in step 19.
0 Comments
Leave a Reply. |