I am developing android application using xamrin and C# I am stuck when I create multiple buttons dynamically and assign them id. When I click on the button I get same id for all the Button. Any one can tell me how to create button with id so each button can be identified using id at runtime.
btnViewSupplier = new Button(this);
btnViewSupplier.Text =Convert.ToString(supplierInformationList[i]);
btnViewSupplier.Gravity= GravityFlags.Left;
btnViewSupplier.TextSize =18;
btnViewSupplier.ScrollBarSize = 20;
btnViewSupplier.SetBackgroundColor(Android.Graphics.Color.ParseColor("#29abe2"));
btnViewSupplier.SetTextColor(Android.Graphics.Color.White);
btnViewSupplier.Id=supplierID[i];
public void callToview()
{
AppCode.ProfileId = Convert.ToInt32(btnViewSupplier.Id);
Console.WriteLine("viewclicked");
StartActivity(typeof(SupplierView));
}