Demo entry 6356523

Android Activity

   

Submitted by anonymous on Apr 19, 2017 at 03:30
Language: Java. Code size: 837 Bytes.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_sign_up);

    Button signUpBtn = (Button)findViewById(R.id.signUpButton);
    signUpBtn.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            EditText usernameEditText = (EditText)findViewById(R.id.usernameEditText);
            EditText passwordEditText = (EditText)findViewById(R.id.passwordEditText);
            Uri accountData = Uri.parse("?username=" + usernameEditText.getText() +
                                        "&password=" + passwordEditText.getText());
            Intent result = new Intent(null, accountData);
            setResult(RESULT_OK, result);
            finish();
        }
    });
}

This snippet took 0.01 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).