Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package pmd.di.ubi.pt.titcherspet;
- import android.content.Intent;
- import android.graphics.Typeface;
- import android.os.Bundle;
- import android.support.v7.app.AppCompatActivity;
- import android.view.View;
- import android.widget.EditText;
- import android.widget.ImageButton;
- import android.widget.TextView;
- public class LoginP extends AppCompatActivity {
- TextView oTView1;
- ImageButton oButton1;
- EditText UsernameEt;
- EditText PasswordEt;
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.login);
- oTView1 = (TextView)findViewById(R.id.app_name1);
- oButton1 = (ImageButton) findViewById(R.id.loginButton);
- UsernameEt = (EditText) findViewById(R.id.username) ;
- PasswordEt = (EditText) findViewById(R.id.password);
- Typeface face= Typeface.createFromAsset(getAssets(), "fonts/BlackBoard.ttf");
- oTView1.setTypeface(face);
- }
- public void onLogin(View v){
- String username = UsernameEt.getText().toString();
- String password = PasswordEt.getText().toString();
- String type = "login";
- int tipo;
- BackgroundWorker backgroundWorker = new BackgroundWorker(this);
- backgroundWorker.execute(type, username, password);
- if(username.equals("admin") && password.equals("admin")){
- Intent Iadmin = new Intent(this,AdminActivity.class);
- startActivity(Iadmin);
- }else{
- // Intent Eadmin = new Intent(this,EducadoraActivity.class);
- //startActivity(Eadmin);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement