Creating a Button and Text view : Android Cafe | Android Studio

Publicado el: 23 noviembre 2019
en el canal de: Android Cafe
120
8

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");
}
});
}
}


En esta página del sitio puede ver el video en línea Creating a Button and Text view : Android Cafe | Android Studio de Duración hora minuto segunda en buena calidad , que subió el usuario Android Cafe 23 noviembre 2019, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 120 veces y le gustó 8 a los espectadores. Disfruta viendo!