Use of Android development--intent

Source: Internet
Author: User

1. Overview

Intent is responsible for the action of an operation in the application, the data involved in the action, additional data to describe, play the role of the media. Specify an activity through the intent object, using StartActivity or

The Startactivityforresult method initiates another activity. In addition, intent can implement data jumps between different activity.

2.activity Jump

3. Create a Intent Object

3.1 Creating the intent object in the original Activity.java file

Note: Intent (Originactivity.this,newactivity.class), that is, to jump, jump activity class name.

3.2 Effect Display

After clicking:

4.Intent Passing Data

4.1 Sending data

Use the Putextra (Key,value) method to transfer data through the intent object.

4.2 Receiving data

Use the Getintent (). Getstringextra (key) method to receive data

4.3. Effect display

After clicking:

Use of Android development--intent

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.