package com.example.tiaozhuan;
import java.util.ArrayList;
import java.util.List;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.Spinner;
public class Edit extends Activity {
private Button btn8;
private Button btn9;
private Spinner sp1;
private EditText edt1;
private EditText edt2;
private EditText edt3;
private RadioGroup sex;
private CheckBox checkbox1;
private CheckBox checkbox2;
private CheckBox checkbox3;
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.edit_information);
btn8=(Button)findViewById(R.id.button10);
btn9=(Button)findViewById(R.id.button09);
sp1=(Spinner)findViewById(R.id.spinner01);
List
list=new ArrayList
();
list.add("xxxx");
list.add("xxxx");
list.add("xxxx");
list.add("xxxx");
list.add("xxxx");
list.add("xxxx");
list.add("xxxx");
list.add("xxxx");
list.add("xxxx");
ArrayAdapter
adapter=new ArrayAdapter
(Edit.this, android.R.layout.simple_spinner_item, list);//创建一个适配器
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
sp1.setAdapter(adapter);
btn9.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
EditText edt1=(EditText)findViewById(R.id.editText3);
EditText edt2=(EditText)findViewById(R.id.editText4);
EditText edt3=(EditText)findViewById(R.id.editText5);
edt1.setText("");
edt2.setText("");
edt3.setText("");
}
});
btn8.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
edt1=(EditText)findViewById(R.id.editText3);
edt2=(EditText)findViewById(R.id.editText4);
edt3=(EditText)findViewById(R.id.editText5);
sex=(RadioGroup)findViewById(R.id.radiogroup1);
checkbox1=(CheckBox)findViewById(R.id.checkbox1);
checkbox2=(CheckBox)findViewById(R.id.checkbox2);
checkbox3=(CheckBox)findViewById(R.id.checkbox04);
Intent intent=new Intent(Edit.this,show_information.class);
intent.putExtra("name",edt1.getText().toString());
intent.putExtra("xuehao",edt2.getText().toString());
intent.putExtra("home_id",edt3.getText().toString());
for(int i=0;i
最近刚完成了一个项目,花点时间去整理了一下里面的一些简单,却又实用的代码!!!!!