Advertisement
Guest User

MainActivity.java

a guest
Mar 25th, 2016
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. package com.example.programmingknowledge.mysqldemo;
  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.EditText;
  8.  
  9. public class MainActivity extends AppCompatActivity {
  10.  
  11. EditText UsernameEt, PasswordEt;
  12.  
  13. @Override
  14. protected void onCreate(Bundle savedInstanceState) {
  15. super.onCreate(savedInstanceState);
  16. setContentView(R.layout.activity_main);
  17.  
  18. UsernameEt = (EditText) findViewById(R.id.etUserName);
  19. PasswordEt = (EditText) findViewById(R.id.etPassword);
  20. }
  21.  
  22.  
  23. public void OnLogin(View view) {
  24. String username = UsernameEt.getText().toString();
  25. String password = PasswordEt.getText().toString();
  26. String type = "login";
  27.  
  28. BackgroundWorker backgroundWorker = new BackgroundWorker(this);
  29. backgroundWorker.execute(type, username, password);
  30. }
  31.  
  32. public void OpenReg(View view) {
  33. startActivity(new Intent(this,Register.class));
  34. }
  35.  
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement