Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package bixby.party;
- import android.app.Activity;
- import android.os.Bundle;
- import android.view.View;
- import android.widget.Button;
- import android.widget.EditText;
- import android.widget.Toast;
- public class NewEvent extends Activity {
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.edit_text);
- final EditText eventNameET = (EditText) findViewById(R.id.eventNameET);
- final EditText locationET = (EditText) findViewById(R.id.locationET);
- final EditText numGirlsET = (EditText) findViewById(R.id.girlsET);
- final EditText numGuysET = (EditText) findViewById(R.id.guysET);
- final Button button = (Button) findViewById(R.id.eventButton);
- button.setOnClickListener(new View.OnClickListener()
- {
- public void onClick(View v)
- {
- // Perform action on click
- String eventName = eventNameET.getText().toString();
- String location = locationET.getText().toString();
- String numGirls = numGirlsET.getText().toString();
- String numGuys = numGuysET.getText().toString();
- String display = eventName + ":" + location + ":" + numGirls +
- ":" + numGuys;
- // uncomment to clear text after buttonpress
- // edittext.setText("");
- Toast.makeText(NewEvent.this, display, Toast.LENGTH_SHORT).show();
- }
- });
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement