Advertisement
Guest User

Untitled

a guest
Dec 28th, 2016
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.64 KB | None | 0 0
  1. package pmd.di.ubi.pt.titcherspet;
  2.  
  3. import android.content.Intent;
  4. import android.graphics.Typeface;
  5. import android.os.Bundle;
  6. import android.support.v7.app.AppCompatActivity;
  7. import android.view.View;
  8. import android.widget.EditText;
  9. import android.widget.ImageButton;
  10. import android.widget.TextView;
  11.  
  12.  
  13.  
  14. public class LoginP extends AppCompatActivity {
  15. TextView oTView1;
  16. ImageButton oButton1;
  17. EditText UsernameEt;
  18. EditText PasswordEt;
  19.  
  20. @Override
  21. protected void onCreate(Bundle savedInstanceState) {
  22. super.onCreate(savedInstanceState);
  23. setContentView(R.layout.login);
  24.  
  25. oTView1 = (TextView)findViewById(R.id.app_name1);
  26. oButton1 = (ImageButton) findViewById(R.id.loginButton);
  27. UsernameEt = (EditText) findViewById(R.id.username) ;
  28. PasswordEt = (EditText) findViewById(R.id.password);
  29. Typeface face= Typeface.createFromAsset(getAssets(), "fonts/BlackBoard.ttf");
  30. oTView1.setTypeface(face);
  31. }
  32.  
  33. public void onLogin(View v){
  34.  
  35. String username = UsernameEt.getText().toString();
  36. String password = PasswordEt.getText().toString();
  37. String type = "login";
  38. int tipo;
  39. BackgroundWorker backgroundWorker = new BackgroundWorker(this);
  40. backgroundWorker.execute(type, username, password);
  41. if(username.equals("admin") && password.equals("admin")){
  42. Intent Iadmin = new Intent(this,AdminActivity.class);
  43. startActivity(Iadmin);
  44. }else{
  45. // Intent Eadmin = new Intent(this,EducadoraActivity.class);
  46. //startActivity(Eadmin);
  47. }
  48. }
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement