Advertisement
lexanu

Untitled

Dec 17th, 2016
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. package com.example.android.userdatabase;
  2.  
  3. import android.content.Intent;
  4. import android.os.Bundle;
  5. import android.support.v7.app.AppCompatActivity;
  6. import android.view.View;
  7. import android.widget.EditText;
  8.  
  9. public class MainActivity extends AppCompatActivity {
  10.  
  11. @Override
  12. protected void onCreate(Bundle savedInstanceState) {
  13. super.onCreate(savedInstanceState);
  14. setContentView(R.layout.activity_main);
  15. }
  16.  
  17.  
  18. public void loginClick(View view)
  19. {
  20. String username;
  21. String password;
  22.  
  23. EditText usernameText= (EditText) findViewById(R.id.editText);
  24. username=usernameText.getText().toString();
  25.  
  26. EditText passwordText= (EditText) findViewById(R.id.editText);
  27. password=passwordText.getText().toString();
  28.  
  29.  
  30. Intent iintent=new Intent(MainActivity.this,userhome.class);
  31. startActivity(iintent);
  32. iintent.putExtra("username",username); //Optional parameters
  33.  
  34.  
  35.  
  36. }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement