Created
February 23, 2016 02:00
-
-
Save luizmarcus/b929ec97631fcc17b787 to your computer and use it in GitHub Desktop.
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
public class MainActivity extends AppCompatActivity { | |
private EditText user, pass; | |
private Button submit; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_main); | |
user = (EditText) findViewById(R.id.user); | |
pass = (EditText) findViewById(R.id.pass); | |
submit = (Button) findViewById(R.id.submit); | |
} | |
public void login(View view){ | |
if (user.getText().toString().equals("Testeapp") && pass.getText().toString().equals("Password")){ | |
startActivity(new Intent(this,SecondActivity.class)); | |
}else { | |
Toast.makeText(this,"Usuário ou senha inválido",Toast.LENGTH_LONG).show(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment