如何在10个活动中加总

时间:2018-07-21 06:13:36

标签: android-studio

我有10套问题,用户将回答,下面是“基本”代码。`

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_question);


    RadioButton  no1 = (RadioButton )findViewById(R.id.no1);
    RadioButton sometimes1 = (RadioButton)findViewById(R.id.sometimes1);
    RadioButton yes1 = (RadioButton) findViewById(R.id.yes1);

    no1.setOnClickListener(new View.OnClickListener(){
        @Override
        public void onClick(View v) {


            Intent int7= new Intent(Question.this,Question2.class);
            startActivity(int7);
        }

    });

    sometimes1.setOnClickListener(new View.OnClickListener(){
        @Override
        public void onClick(View v) {

            Intent int8= new Intent(Question.this,Question2.class);
            startActivity(int8);
        }

    });

    yes1.setOnClickListener(new View.OnClickListener(){
        @Override
        public void onClick(View v) {

            Intent int9= new Intent(Question.this,Question2.class);
            startActivity(int9);
        }

    });

我的问题是如何对问题的分数求和,以便最终得出类似的结果。enter image description here

0 个答案:

没有答案