我正在创建一个 android 应用程序,它使用来自单击按钮的数据来生成存储在共享首选项中的答案。当用户单击按钮时,我无法找到必要的意图代码来保存信息,以便可以使用它来计算答案。正如您从代码中看到的那样,当用户单击按钮时,它将生成下一个活动。谢谢!
    Button button18 = (Button) findViewById(R.id.button18);
    button18.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            //I need to store the results then move to the next activity shown below?
            Intent i = new Intent(EnterAgeActivity.this, EnterWeightActivity.class);
            startActivity(i);
            // TODO Auto-generated method stub
        }
    });
    `