Advertisement
Guest User

Untitled

a guest
Nov 5th, 2016
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.26 KB | None | 0 0
  1. package com.example.damian.myapplication;
  2.  
  3. import android.content.Intent;
  4. import android.support.v7.app.AppCompatActivity;
  5. import android.os.Bundle;
  6. import android.view.View;
  7. import android.widget.Button;
  8. import android.widget.EditText;
  9. import android.widget.TextView;
  10.  
  11. import butterknife.BindView;
  12. import butterknife.ButterKnife;
  13. import butterknife.OnClick;
  14.  
  15. public class MainActivity extends AppCompatActivity {
  16.  
  17. @BindView(R.id.etUsername) EditText etUsername;
  18. @BindView(R.id.etPassword) EditText etPassword;
  19. @BindView(R.id.btnLogin) Button btnLogin;
  20. //TextView etUsername;
  21. //TextView etPassword;
  22. //Button btnLogin;
  23.  
  24. @Override
  25. protected void onCreate(Bundle savedInstanceState) {
  26. super.onCreate(savedInstanceState);
  27. setContentView(R.layout.activity_main);
  28. ButterKnife.bind(this);
  29.  
  30.  
  31. }
  32.  
  33. @OnClick(R.id.btnLogin)
  34. public void onButtonLoginClick() {
  35. String username = etUsername.getText().toString();
  36. String password = etPassword.getText().toString();
  37.  
  38. Intent menuIntent = new Intent(this, MainActivity.class);
  39. menuIntent.putExtra(IntentExtras.USERNAME, username);
  40. menuIntent.putExtra(IntentExtras.PASSWORD, password);
  41. finish();
  42. }
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement