0
I just want to push the button after all the EditText
's are filled in
package com.example.marcosnogueira.appnote;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.*;
import android.content.*;
public class Principal extends AppCompatActivity {
private EditText nome;
private EditText nomlojcli;
private EditText endereco;
private EditText cpf;
private EditText cnpj;
private EditText tel;
private Button cadastrar;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_principal);
nome = (EditText) findViewById(R.id.nome);
nomlojcli = (EditText) findViewById(R.id.nomlojcli);
endereco = (EditText) findViewById(R.id.endereco);
cpf = (EditText) findViewById(R.id.cpf)
cnpj = (EditText) findViewById(R.id.cnpj);
tel = (EditText) findViewById(R.id.tel);
cadastrar = (Button) findViewById(R.id.button);
cadastrar.setOnClickListener (new View.OnClickListener() {
@Override
public void onClick(View v) {
AlertDialog.Builder mensagem = new AlertDialog.Builder(Principal.this);
mensagem.setMessage("Cadastrado com Sucesso");
mensagem.setNeutralButton("Ok",null);
mensagem.show();
}
});
}
}
Your question is the algorithm? Do you have any idea? Have you tried anything?
– Pablo Almeida
"just press" - refers to being inactive (
Enabled
tofalse
) or simply do nothing when clicked ?– Isac