Two implementation methods of intent additional data of Android

This paper describes two implementation methods of intent additional data of Android. Share with you for your reference. The details are as follows:

The first method is used to batch add data to intent:

The second writing method: this writing method is equivalent to the above writing method, but this writing method is to add data into intent one by one. This writing method is more convenient to use, and only needs to write a small amount of code.

Intent provides a variety of commonly used heavy load putExtra () methods, such as: putExtra (String name, String value), putExtra (String name, long long), within the method (), it will determine whether there is a pair of objects in the current object, if it does not exist, it will create a new object. The values passed in by the method will be stored in the bundle object. The following is the code fragment of intent's putextra (string name, string value) method:

I hope this article will be helpful to your Android program design.

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>