The first Android program was written

Source: Internet
Author: User

Demand Analysis: Enter two numbers, multiply them, and get results

First build an Android project to create the first interface in layout the interface has four components, two EditText a textview, and one Buutton. and set its ID. The Java code creates a new class and inherits the activity through Setcontentview (r.layout. Activity_main) method is associated with the first interface, creating four objects that are associated with four components through the Findviewbyid () method, adding listener events to the button class, and passing the values of two input boxes to the second interface through the intent object

Create a new interface add a TextView component create a new class to inherit the activity class, and associate the second interface with the Getintent () method to get the intent object, multiply the obtained value by a health fetch value, and set the value to the TextView display. Program is programmed to complete

The first Android program was written

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.