我将得分和列表视图大小的变量传递给活动,但是当我使用模拟器时,这些值会发送给活动。当我将应用程序加载到移动设备时,未处理预期的过程 来自适配器的代码
Intent mIntent = new Intent(context, ScoreActivity.class);
mIntent.putExtra("sscore", mScore);
mIntent.putExtra("total", asize);
context.startActivity(mIntent);
活动代码
Intent intent = getIntent();
int mScore = intent.getIntExtra("sscore", 0);
int asize = intent.getIntExtra("total", 0);
TextView score_text = (TextView) findViewById(R.id.score);
score_text.setText(" " +mScore+" ");
TextView total_text = (TextView) findViewById(R.id.total_value);
total_text.setText("Total= " + asize);
谢谢