So as you can see here I also implemented this view that unclick eggless or remove it.
And as you can see here.
They did it about an object and the image view object or both of them actually are the subclass of The
View class.
OK.
So we can refer to those objects as views OK because there is actually an is a relationship between
these objects.
And as you can see here I can just switch between the ideas of my for example a button and my image
view I want to differentiate between Actually my button and my image view.
So whenever the user clicks on my button case our thoughts are indeed bitty.
And so if the user clicks on the button here.
I actually created an intent object.
OK.
Intent and the name of this object is intent.
New intent.
OK.
And here are for the constructor of this class as you can see here main activity that this first of
all we need to actually specify.
So this is going to be the class that we want to actually move from.
OK main activity that this this is going to be are of first argument.
OK.
And our second argument is the class that you're going to actually transfer to.
OK.
We want to actually transfer from this activity the main activity to the second activity.
OK.
So how we can do that.
So in order to do that we need to actually create an intent object.
OK.
And here you can see here we don't have the second activity class yet.
That's why it is now showing us an error.
So we it actually creates that class that class in a minute.
So the first that we actually are talking about these lines of quote here and here I want to actually
pass some information from the main activity class to the second and second activity class.
So in order to do that I need to just refer to the name of this intent intent.
Object that put extra.
And here we need to actually specify the key of the value that you want to pass to and other activity.
So this name is actually the key.
OK.
Inside is double quotes.
OK.
And as you can see here this value is capitalized.
So always capitalized your keys.
OK.
So this is our key name and the second one is that the second argument is the value that you want to
actually pass from this activity to the second activity.
It is the name that takes the two strings.
OK.
So as you can see here in say this activity minute example.
So whatever value the user enter is this text here is going to be actually passed from this value to
another value.
OK.
So I have this value here.
It is the name that takes that to a string.
And here as you can see intent that put extra email.
So here it is.
This is going to be our key email.
As you can see here this is capitalized.
And for the second argument I'm want to actually I actually specified the value that I want to pass
from this activity to another activity.
EDT e-mail that get text twisting.
Again I have this line of code here intent that extra that put extra.
And here I am specifying the key user underline name and the second one is there actually is actually
the value that I want to pass from this main activity class to the second activity class.
It is a username that takes the two strings.
And here again intent that put extra password this is alci it is password gettext that to a string.
And here it is.
That puts extra.
And here as you can see here I am actually specifying the key gender type.
And the second value is the gender's type.
So here as you can see in our main activity class I have this string value.
It is a variable gender type.
OK.
So now as you can see I am specifying that the key is going to be gender type and I want to pass that
string value from this activity to the second activity class.
And now as you can see here because I want to I want also to actually pass this image from this activity
to another activity.
I also need to actually do something with that image.
OK.
So in order to actually pass one image from one activity to another activity you need to actually convert
that image to an array of bytes.
OK.
So for that specific job I need to actually create an object of type byte array output stream as I did
here.
Both are a output stream and the name of this object is Stream new byte at a output stream.
So here I actually created an object of type byte.
Ari with stream and here I actually fared to the name of this a bitmap object that I actually declared
inside this mean activity class bitmap bitmap object.
So here as you can see bitmapped does compress.
So hit it because I want to actually pass this image to another other activity.
I need to actually compress this image this bitmap object so bitmap that compress for the first argument
I need to specify the format of the image that I want to pass from this activity to another activity
bitmap that compress format that P and G.
OK so our image is going to be at an IP and defined.
OK.
And for the second argument we need to specify the quality of our image.
So 100 is good enough and for the first argument we need to specify the byte Aure outputs an object
as you can see here.
I assigned this object here for the first argument and here in line 82 I actually created an array of
type byte.
OK.
And the name of this area is byte array assignment operator and here as you can see I referred to the
name of this object byte.
Are they out with the stream object.
Stream dots to bite arii.
So I am actually converting this stream object to actually to our bite array object and that I am assigning
that value to despite the error here.
As you can see.
And here I am actually ascending this image to another activity intent that puts extra.
OK.
Intent does put extra.
So for the first argument as against it see is going to be ARCI.
So remember always capitalize your keys.
So I just need to type in here.
Peak sure as it against here.
And our second argument is bytes at a.
Here as you can see.
And now as you can see here I am actually starting this activity here start the activity intense.
So here are because I want to move from this activity to another activity I need to write this code
here to start activity intent.
So it is going to actually open the second activity and then it's going to actually pass these values
from this activity to another activity.
So now I need to actually create the second activity class.
OK.
So in order to do that because all you want to actually create an activity here I need to I can just
click on this package here.
That example that Matas or saw that that at 44 here.
Just select this package and then click on File New and then click on activity.
As you can see here we have this activity here and now a selectees empty activity here.
You can actually you can actually select these activities here.
But for our application just select this empty activity.
And now we can actually specify the name of your activities.
So just type in here a activity.
Here as you can see it says generate a find.
So make sure that this option is actually checked.
So it's going actually to create a layout file for you for your activity and here this is going to be
the name of our out activity the line segment and this is going to be our package that this activity
is going to be inside it.
So now click on finish and now as you can see our activity our second activity is actually created and
here inside is lay out fight as you can see we have this activity underline say in that example here
that is actually related to the second activity that goes up.
So here as you can see we have dismasted set content view.
Our thoughts lay out that activity the second segment.
So this is our ASML fight that is related to this activity here second activity that of a fight and
in our Android manifest here as you can see we also have this line of code here.
So the idea is automatically generated this line of code for us activity and Royte name that second
activity.
OK.
So now we also declared this our second activity in our manifest here and now.
So first of all let's actually go back to our activity Underland second that example here and now I
want to actually design the user interface of our second activity class.
OK.
So now OK now I want to actually design the user interface of our second activity so first of all let's
actually track a linearly out vertical at the center of this relatively out here.
OK.
These are relatively out and I put this linearly out vertical at the center of this relatively out.
OK so now let's actually drag an image view into this linearly out vertical.
So as you can see here inside these widgets folder I have this image view here just selected at and
put it at the center of this linearly outwards.
And as you can see here let's actually assign the value hundred for the layout of this of this image
view 200.
And it's actually assigned the value 200 for the layout height of this image.
And then press on until key on your keyboard.
And as you can see here the layout gravity is centered horizontal.
And now let's actually assign an ID to this image view our AMG animal received and then press on into
here on your keyboard.
So the idea of this image is all in the animal received.
OK and now let's actually select this takes your large takes you inside these widgets folder and put
it inside is linearly as vertical OK.
Just put it here.
Below these are image view and double click on it just deletes the text of this text view and for the
ID just type in here takes the name or KTXA the name and then press on enter key on your keyboard.
And that's actually assigned a value match Pallant for the layout.
Which of these takes you so select this match parent here and now present enter key on your keyboard.
OK.
And then Arliss actually as you can see here the left gravity is centered horizontally.
And now essentially find the gravity attribute that is related to the state's view.
So this is our gravity attribute.
Open it.
And that's actually as you can see it this is our center horizontal attribute that is related to the
space view just accelerated and checked is checkbooks.
OK.
So it's going to actually center the children of these states so that the children of this this is going
to be the text of the state's view.
So if it sticks you and just assign a text to the state's view.
Now as you can see the text is actually at the center horizontal of this takes you here.
OK.
So it's a double click on it and deletes the text of this text view.
Now let's actually write and order a text view into this linearly I-30 call.
So just select it and put it below this takes you here and inside the city nearly out vertical and WTNH
deletes the text of the state's view.
And for the idea just typing here takes the email th the e-mail received and then our press Enter key
on your keyboard.
And then again for the lay out with assigned the value match Pallant and actually find the let's actually
find the gravity attribute this is the gravity attribute that is related to the state's view and then
our checked is our center horizontal here.
As you can see.
And let's actually right another large stakes into this linearly vertical and put it at the center horizontally
OK of these are linearly aesthetical OK.
Just put it at the center horizontal double clicked on it deletes the text of the state's view and for
the ID just type in here TXI the user name and then press on entelechy on your keyboard and faultily
outfit.
Assign the value match parent match parent.
And let's actually find that gravity attributes.
This is the gravity attribute and then select the center horizontal here and check this checkbox.
So now let's actually right and our other large takes you into this linearly as vertical and put it
at the center horizontal of this linearly.
I swear to god.
So this is our last this year and I'm going to put it at the center horizontal of this linearly at Hollys
linearly Ellsworthy Karl.
Double click on it delete the text of this text view and for the ID just type in here takes the password
and then press on Enter key on your keyboard again.
Assign the value of match parent for the layout of this RTX the passport here.
And let's actually find the gravity attribute here.
As you can see this is the gravity attribute.
And then let's actually check this center horizontal checkbox here and now.
Let's actually go back to our main activity class here and here as you can see I am actually passing
these values to that to the next activity to the second activity.
And as you can see here this area is gone.
Second activity that class and here I to actually pass these values.
Name email username password gender type.
And then here I am I am I truly I want to pass the image from this activity to another activity.
OK.
And I actually decided to convert that image to to actually a bite out of a output stream.
And here as you can see it bitmap that compress.
And here I am actually compressing that image bitmap.
And here I created an array of type byte.
And here I actually called these two byte RMF at on this string object here that is of type byte array
out with STREAM.
And then here I want to actually pass this a byte at a here to the second activity intense that put
extra.
This is going to be the key and point at me.
So I actually converted my image to I got to actually a byte array.
OK to an array of bytes and then I can actually pass this image from this activity to the second activity.
And here I am actually starting the second activity start activity intense break.
And as you can see here we have another case statement here.
Case that ID that I am the animal.
And here I created another intent object intent intent image new intent.
And here I want to actually open this action.
Intent that action gets content.
So I want to actually open the photos of my actually device the photos application of my device and
then I can actually access the images that are inside of my device.
OK.
So here I referred to this object intent image that said type.
OK.
So here I want to actually open the photos application image slash start.
OK.
So I need to put these values in so the double quotes and here are because I want to actually get an
image from my Actually for my photos application in my device.
I need to actually call this summer if it starts activity for resolved.
OK.
This is very important because we want to receive an image from my photos application in my device.
I need to call the Smurfette start activity for resolved Internet image image request court.
So as you can see here in our main activity class I created this constant.
OK this is our image request.
1000.
OK.
And this is our image request code that is related only to this image.
I need you anymore object because whenever the user clicks on that image it's going to open the photo
application and then we can actually select an image and then we can receive that image.
And this is really important that we have a unique request code for that because there are components
on my screen.
May want to access the photos application but this requires code that determines the images that are
actually received by clicking on this.
I am the animal is going to be actually specifically for this I am the animal image for you.
And here I actually tighten break so that it's going to actually break out of this sweet statement.
So here because you want to actually want to receive an image from the photos application by clicking
on this or by clicking on this image of you need to actually overwrite the activity of the activity
results method.
So now as you can see our application is actually running on this emulator.
So let's actually click on this image here and now as you can see our photos application is actually
opened.
And I can actually select an image for here.
So now I can actually select for example just this internal storage.
So just a click on the menu he had menu button and then click on this internal storage.
And here I can actually select these pictures directory as you can see here we have this we have these
pictures directory and here inside these animal images.
I have these images here.
OK.
So here I can just select the spirit that PND.
And now you can see we don't see that image here.
OK.
So that's why we need to actually override the unactivated results method because we want to receive
an image from the photos application in our device.
So in order to do that I actually pasted some of it here and now I'm going to explain to you what's
going on here.
So as you can see here before the access modifier of this method is protected so only the subclasses
of the so so so only are the subclasses of the activity class can actually can actually overwrite Smurfette
or access this method.
So the the the access modifier is protected and the return type is void.
So this means that this is going to return nothing.
OK.
And the name of the Smurfette is an activity result.
And we have free arguments here.
OK.
It requires code.
OK so this is the request code an e-mail request quote that I actually declared here.
As you can see Final in our image request code 1000.
OK.
And here as you can see into request code in result code in intent data.
OK so we have these arguments.
So whenever we want to actually receive some data from another application or from another activity
we need to override this on activity resolved.
OK.
And then we also need to actually open that activity or open that application or by using this method
start activity for result.
Ok not this start activity start activity for result and then we need to pass the intent and our request
code.
OK.