I have activity with list of products and I pass attributes to Basket activity
Code in products list activity:
zakazat.Click += delegate
{
var intent = new Intent(this, typeof(CartActivity));
intent.PutExtra ("title", (string)(firstitem ["post_title"]));
intent.PutExtra ("price", (string)(firstitem ["price"] + " грн"));
intent.PutExtra ("weight", (string)(firstitem ["weight"] + "г"));
StartActivity(intent);
Receiving products in Basket:
public void Display (){
LinearLayout display = FindViewById<LinearLayout> (Resource.Id.product1);
TextView productname = FindViewById<TextView> (Resource.Id.posttittle1);
TextView price = FindViewById<TextView> (Resource.Id.price1);
TextView weight = FindViewById<TextView> (Resource.Id.weight1);
price.Text = Intent.GetStringExtra("price");
productname.Text = Intent.GetStringExtra("title");
if (productname.Text == Intent.GetStringExtra ("title")) {
display.Visibility = ViewStates.Visible;
}
else {
display.Visibility = ViewStates.Gone;
}
weight.Text = Intent.GetStringExtra("weight");
}
I have two questions, how save this attributes when I change activity and how to pass this attributes on background?
Any suggestions how I can realize this?