Xamarin Android activity between jump and pass value

Source: Internet
Author: User

Preface

Because of the need, so exposure to this new Android development model, I will be all my learning experience recorded, I hope to be useful to everyone.

Guide

As for activity, people who have studied Android should also understand what activity is and recommend a novice to see the life cycle of the YZF article, which details the life cycle of the activity and some usage.

Body

Activity jumps and transmits values, mainly through the intent class to connect other activity for data transfer.

1. No data jump

New Intent (thistypeof(ADD));                        StartActivity (intent);

The add is the activity that jumps.

2. With Data jump

Mainactivity.cs

New Intent (thistypeof(Uduser));            Intent. PutExtra ("ID", PID);            StartActivity (intent);

where "id" is simply to define a name for this pass-through value, so that it is received and the PID is the value.

Receive pass-through values

Uduser.cs

var yourid = Intent.getstringextra ("ID");

Xamarin Android activity between jump and pass value

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.