The Android Implementation page jumps

Source: Internet
Author: User

Implement a page jump.

You can Specify a method under the button buttons in the XML layout.

Android:onclick = "SendMessage"

The SendMessage method is then defined in the corresponding Java file .

 Public void SendMessage () {Intent  new  Intent (); Intent.setclass ( This, Nextactivity. class ); startactivity (intent);}

Or you can directly implement monitoring of the control:

Bt.setonclicklistener (new  Onclicklistener () {//override its OnClick method public   voidnew  Intent (); Intent.setclass (This, Nextactitivy.  Class); startactivity (intent);}})

You can also use the following method to pass character parameters, using the Intent.putextra () method.

Intent.putextra () method:

PutExtra ("A", B):AB is a key-value pair, the first parameter is the key name, and the second parameter is the value.

If you want to remove an object from Intent, you need to use the Get***extra ("A") method in another Activity, where the parameter is the key name,* * * represents the type of the parameter, For example, you can use the Getstringextra () method to remove a value of type String

The Android Implementation page jumps

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.