Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What Does Intent.putExtra will do

I am new to android and I use intents to transfer data from one Activity to another. I just wanted to know whether the object reference or object copy is sending to the second Activity.

like image 668
Software Sainath Avatar asked Apr 05 '13 05:04

Software Sainath


People also ask

What is the use of intent putExtra?

Using putExtra() and getExtras() in android For example an Activity can send an Intents to the Android system which starts another Activity . putExtra() adds extended data to the intent. It has two parameters, first one specifies the name which of the extra data,and the second parameter is the data itself.

Whats the difference between putExtra and PutExtras methods used in intent?

PutExtra() - we can store any primitive data type directly with (key,value) pair. And PutExtras() - hold object of Bundle class object . Bundle class provide us method of specific primitive data type methods to store data in it.

What is intent setType?

setType(String mimeType) input param is represent the MIME type data that u want to get in return from firing intent(here myIntent instance). by using one of following MIME type you can force user to pick option which you desire. Please take a Note here, All MIME types in android are in lowercase.

What is the use of Intent in Android Studio?

An Intent object carries information that the Android system uses to determine which component to start (such as the exact component name or component category that should receive the intent), plus information that the recipient component uses in order to properly perform the action (such as the action to take and the ...


1 Answers

Intent.putExtra sends a copy of the object it is not the same reference when you get the extra from the intent you make the new reference there

like image 59
JRowan Avatar answered Sep 28 '22 01:09

JRowan