Tip : view video in 2x to save time :-)
So here's a quick tutorial in which beginner can learn how they can implement their first text view and Button and add activity to the button . SO, when the user click on button it show a message in response to your OnClick.
in this video you will learn how to implement a button and text view within 5 min.
java Code:
package com.example.buttonapp;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
public class MainActivity extends AppCompatActivity {
TextView textView;
Button button;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
textView.setText("Button app");
}
});
}
}
On this page of the site you can watch the video online Creating a Button and Text view : Android Cafe | Android Studio with a duration of hours minute second in good quality, which was uploaded by the user Android Cafe 23 November 2019, share the link with friends and acquaintances, this video has already been watched 120 times on youtube and it was liked by 8 viewers. Enjoy your viewing!