展示
在点击跳转按钮的页面写
Intent intent = new Intent();
String name = list.get(potion).getCommodityName();
String pic = list.get(potion).getMasterPic();
int price = list.get(potion).getPrice();
intent.putExtra("name",name);
intent.putExtra("pic",pic);
intent.putExtra("price",price);
intent.setClass(MainActivity.this, TwoActivity.class);
startActivity(intent);
在展示的页面写
imageView = findViewById(R.id.image);
text_name = findViewById(R.id.name);
text_price = findViewById(R.id.price1);
Intent intent=getIntent();
String image = intent.getStringExtra("pic");
String price = intent.getStringExtra("price");
String name = intent.getStringExtra("name");
text_name.setText(name);
text_price.setText(price);
Glide.with(TwoActivity.this).load(image).into(imageView);