在我的申请中,用户选择了一个无线电台,表明他想要做这个选择的体育比赛的参与者有多少。 之后,该数字被送往另一活动,以展示。 如果可能的话,如何利用无线电台的id子,并脱掉“无线电”部分,只剩下4-10号 in子?
package teamBuilder;
import com.jonahwitcig.team.R;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.*;
public class CorrectedActivity extends Activity {
/** Called when the activity is first created. */
TextView player1, team1;
Button next;
RadioGroup RBGroup;
RadioButton RB4, RB5, RB6, RB7, RB8, RB9, RB10;
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.players);
next = (Button) findViewById(R.id.next);
//the name of a textView i will be displaying a number in
team1 = (TextView) findViewById(R.id.team1);
RB4 = (RadioButton) findViewById(R.id.radio4);
RB5 = (RadioButton) findViewById(R.id.radio5);
RB6 = (RadioButton) findViewById(R.id.radio6);
RB7 = (RadioButton) findViewById(R.id.radio7);
RB8 = (RadioButton) findViewById(R.id.radio8);
RB9 = (RadioButton) findViewById(R.id.radio9);
RB10 = (RadioButton) findViewById(R.id.radio10);
//names of my radio buttons
RBGroup = (RadioGroup) findViewById(R.id.RBGroup);
RBGroup.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
public void onCheckedChanged(RadioGroup RBGroup, int checkedId) {
team1.setText(checkedId);
}
});