From the course: Xamarin Essential Training: Create Your First App

Unlock the full course today

Join today to access over 23,200 courses taught by industry experts.

Solution

Solution

(techno intro music) - [Speaker] We'll start our solution by going to the Product class. And I'm simply going to use the prop, tab, tab. I'm going to say this is an int, yet, I'm going to call it Id. And that's all I need to do there. We'll go to the MainActivity. Remember we had this chained logic here, we can put things in here. So I'll do a PutExtra, I'm going to call it id, and then I'm going to use that selectedProduct.id. That now is going to put that integer value in there. And then we come to the ProductDetailActivity. You'll remember, we were getting those values out of that Intent. So I'm going to copy this. Add a new line, we'll paste that. And here I'm going to get the productId. We're going to have to create this cause we don't have it yet. I need another label and I'm going to try to GetIntExtra. And we'll call that, or we'll refer to that with the id value. And of course, since that's an int, and we're…

Contents