Home > Mobile >  How Intent moves according to the different content of the page a different data
How Intent moves according to the different content of the page a different data

Time:12-02

Similar taobao commodity details page, click the buy now button, and then jump to another page, how to transfer images at the same time, title, such as

CodePudding user response:

The first page
Intent=new intent (MainActivity. This, Aty1. Class);
Intent. PutExtra (" img_src ", "img_src");//this pass you the picture path
Intent. PutExtra (" title ", "XXXX");//this pass your title
StartActivity (intent);
The second page:
Intent Intent=getIntent ();
String imgSrc=https://bbs.csdn.net/topics/intent.getStringExtra (" img_src ");
String title=intent. GetStringExtra (" title ");

CodePudding user response:

You transfer pictures, that is, it passed the address of the line, is nothing more than a string

CodePudding user response:

Pass the json string in the past, get on another page? Take it again
  • Related