Advertisement
Guest User

Untitled

a guest
May 2nd, 2017
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. protected void onCreate(Bundle savedInstanceState) {
  2. super.onCreate(savedInstanceState);
  3. setContentView(R.layout.activity_startup);
  4. LoginButton();
  5. }
  6.  
  7. public void LoginButton(){
  8. username = (EditText)findViewById(R.id.login_username);
  9. password = (EditText)findViewById(R.id.login_password);
  10. login_button = (Button)findViewById(R.id.startup_login_button);
  11. login_button.setOnClickListener(
  12. new View.OnClickListener() {
  13. @Override
  14. public void onClick(View v) {
  15. if (username.getText().toString().equals("admin") && password.getText().toString().equals("admin")){
  16. Intent intent = new Intent(getApplicationContext(),MainActivity.class);
  17. startActivity(intent);
  18. }
  19. }
  20. }
  21. );
  22. }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement