我使用此代碼通過INT到機器人活動
Intent intent = new Intent(A.this, B.class);
intent.putExtra("selectedType", i);
startActivity(intent);
,然後再通過INT到下一個活動的活性乙收到此
Intent intent = new Intent();
int i = intent.getIntExtra("selectedType", 0);
Toast.makeText(getApplicationContext(), String.valueOf(i),
Toast.LENGTH_LONG).show();
但是當在該活動中,它總是顯示0
很多正確答案是given..so請接受正確的答案。 –