Created
August 16, 2018 00:36
-
-
Save cezar08/17e38e3f3e3c49bd885b01c4d1ca9bdd to your computer and use it in GitHub Desktop.
MainActivity.java
This file contains hidden or 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
| package com.example.administrador.myapplication2; | |
| import android.support.v7.app.AppCompatActivity; | |
| import android.os.Bundle; | |
| import android.util.Log; | |
| import android.view.View; | |
| import android.widget.Button; | |
| import android.widget.EditText; | |
| import android.widget.Toast; | |
| public class MainActivity extends AppCompatActivity { | |
| @Override | |
| protected void onCreate(Bundle savedInstanceState) { | |
| super.onCreate(savedInstanceState); | |
| setContentView(R.layout.activity_main); | |
| Button btnCliqueAqui = (Button) findViewById(R.id.btnCliqueAqui); | |
| btnCliqueAqui.setOnClickListener(new View.OnClickListener() { | |
| @Override | |
| public void onClick(View view) { | |
| EditText edtNomeCampo = (EditText) findViewById(R.id.edtNomeCampo); | |
| Toast.makeText( | |
| getApplicationContext(), | |
| edtNomeCampo.getText(), | |
| Toast.LENGTH_SHORT | |
| ).show(); | |
| } | |
| }); | |
| } | |
| // public void cliqueAqui(View v) { | |
| // Log.d("Log", "Clicou no botão"); | |
| // } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment