Welcome back.
You probably have noticed that once you create a new board, the board will not be displayed.
So I'm just going to create a new board here in Port one.
It's not going to be displayed in our boards here.
So it's not reloading this page.
Right.
So that is something that we can add as well.
So once we create a new board and we click this button, we pretty much want to get a result from it.
So we create a board with a start activity for result, or we click this button and we start the activity
for results so that we get to this screen here.
And once we click the create button, then it will also send us the information that there was a new
entry made.
And if that is the case, then we want to reload the boards.
All right.
So let's go ahead and add that functionality in real quick.
Therefore, in the main activity, I will create a new entry here at the very top in our companion object.
So I'm just going to create a new concept, will create board request code, which I'm going to assign
the value to one to two, OK?
Now, the next thing is that we can start the activity for results once we click on the create board
button.
So here FEBA create a board.
And currently we start the activity, but but without asking for a result, so I'm going to change that
now.
Start activity for results with the intent and with our create board request code code.
OK, now the next step that we need to prepare is to set the result as OK once we get over to the cricket
board activity.
And to be precise, we want to.
Do that once the board was created successfully.
All right, so let's go over to our activities here and create board activity.
So here.
We have this function that we created, which was called create board successfully.
All right, so here what we will do is we will just set the result to be activity that result.
OK.
Now, in the main activity, we have this one activity result function.
This one here and we now can check.
So let's create another iffier else if.
And here what we want is.
To check if the result code was OK, so pretty much the same thing as we had before, and if the request
code is.
And how do you call it request code, create port request code?
This one here, if it's that code, then we want to run some code, which means I just want to go to
our store class here and get the boards list once again.
And here we didn't just pass in the get list activity that we need here.
So it's going to be this.
And now let's run this again on the device.
Now, let's go ahead and create the new board.
So that we aren't we see what one is here now, this cricket board to.
Or whatever the name doesn't really matter what created successfully and then you can see it's here
as well.
OK, so now we have this functionality that allows us to update our passports directly once we created
a new board.