I am adding my button and the click event from a class, When you click the button you need to go to a different content view and bring a variable with it.
protected override void OnPostExecute(Java.Lang.Object result)
{
base.OnPostExecute(result);
pd.Dismiss();
if((bool)result)
{
lv.Adapter = new CustomAdapter(c, meters);
lv.ItemClick += Lv_ItemClick;
}
else
{
Toast.MakeText(c,"Unable To Parse",ToastLength.Short).Show();
}
}
private void Lv_ItemClick(object sender, AdapterView.ItemClickEventArgs e)
{
Toast.MakeText(c, meters[e.Position].EAN, ToastLength.Short).Show();
}
The Toast displays the data that should be shown in the next content view.
SetContentView doesn't work from a class.
SetContentView(Resource.Layout.address_data);
How do I change content view from a class? and how would I get the data to the new view?
SetContentView(Resource.Layout.address_data);
I found the solution:
For giving the data with the new view I used: