Android page Jump

Android uses intent to realize page Jump. Intent starts the activity through startactivity (intent intent) or startactivityforresult (intent intent, int resquestcode). When creating an intent object, it specifies to jump from page a to page B,

For example:

The intent object passes the information that needs to be passed when the page jumps by calling the putextra method

For example:

Putextra ("name the information to be transmitted" and the content of the information to be transmitted)

Intent accepts the passed information by calling the getstringextra method

Getstringextra ("name of the passed information");

The following code will enable the user to click the login button after entering the information, and the page will jump to another page to display personal information. Then there is a return button on this page. Click the return button, and the page will return to the login page to display personal information again.

MainActivity.java

MainActivity2.java

test.xml

activity_ main2.xml

summary

The above is the Android page Jump introduced by Xiaobian. I hope it will help you. If you have any questions, please leave me a message, and Xiaobian will reply to you in time. Thank you very much for your support for the programming tips website!

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>