Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.example.form;
- import android.support.v7.app.ActionBarActivity;
- import android.os.Bundle;
- import android.view.View;
- import android.widget.EditText;
- import android.widget.RadioButton;
- import android.widget.Toast;
- public class MainActivity extends ActionBarActivity {
- EditText imie;
- EditText nazwisko;
- EditText zainteresowania;
- RadioButton man;
- RadioButton woman;
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_main);
- imie = (EditText)findViewById(R.id.editText1);
- nazwisko = (EditText)findViewById(R.id.editText2);
- zainteresowania = (EditText)findViewById(R.id.editText3);
- man = (RadioButton)findViewById(R.id.radioButton1);
- woman = (RadioButton)findViewById(R.id.radioButton2);
- }
- public void funkcja(View view){
- if(man.isChecked())Toast.makeText(getApplicationContext(), "Witaj "+
- imie.getText()+" "+
- nazwisko.getText()+" "+
- "jestes mężczyzną a Twoje zainteresowania to: "+
- zainteresowania.getText(), Toast.LENGTH_LONG).show();
- if(woman.isChecked())Toast.makeText(getApplicationContext(), "Witaj "+
- imie.getText()+" "+
- nazwisko.getText()+" "+
- "jestes kobietą a Twoje zainteresowania to: "+
- zainteresowania.getText(), Toast.LENGTH_LONG).show();
- Intent sendSms = new Intent(Intent.ACTION_SENDTO, Uri.parse("sms:xxxxxxxxx"));
- sendSms.putExtra("sms_body", "Witaj "+imie.getText()+"");
- startActivity(sendSms);
- }
- public void _man(View view){
- woman.setChecked(false);
- }
- public void _woman(View view){
- man.setChecked(false);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement