第一個Activity:FirstActivity
Bundle bundle = new Bundle();
//保存id
bundle.putInt("id", comment.getId());
Intent intent = new Intent(getApplicationContext(), SecondActivity.class);
intent.putExtra("bundle", bundle);
//跳轉
startActivity(intent);
第二個Activity: SecondActivity
//取出傳過來的id
Bundle bundle = this.getIntent().getBundleExtra("bundle");
int id = bundle.getInt("id");