1.1.4 Getting started_budding Your first app_starting another Activity

Source: Internet
Author: User

An is a Intent object that provides runtime binding between separate components (such as both activities). The intent represents an app's "intent to do something." You can use the intents for a wide variety of the tasks, but the most often they ' re used to start another activity.

Intent is a thing: it provides runtime bindings between different components, such as two activity. Intent represents an app "intent to do something". You can use intent to do many types of tasks, but usually it is used to start another activity

Inside sendMessage() The method, create an to Intent start an activity called DisplayMessageActivity :

Intent=newIntent(this,   Displaymessageactivity. class );

The constructor used here takes the parameters:

    • A as its first Context parameter (was this used because the Activity class is a subclass of Context )
    • Classthe of the app component to which the system should deliver Intent the "the activity that should be s tarted)

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.