我正在开发由edittext 字段和复选框组成的应用程序。如果用户只选择了其中的几个,那么如何从字段中获取这些文本值。
public class ExtraFields extends Activity{
Button btnSubmit;
int noOfFields=0;
@Override
public void onBackPressed() {
// TODO Auto-generated method stub
super.onBackPressed();
finish();
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
this.requestWindowFeature(Window.FEATURE_NO_TITLE); // Removes title bar
this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN); // Removes bar
setContentView(R.layout.extra_fields);
btnSubmit = (Button) findViewById(R.id.submit);
btnSubmit.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
noOfFields = 0;
send();
}
});
}
protected void send(){
}
}