hi...m getting errors at TableItem at every where in my code namespace EtSpSqlite { [Activity(Label = "HomeScreebAdapter1")] public class HomeScreenAdapter1 : BaseAdapter<TableItem> //the type or namespace name 'TableItem' could not be found(are u missing a using directive or an assembly reference?)// { List<TableItem> items;//the type or namespace name 'TableItem' could not be found(are u missing a using directive or an assembly reference?)// Activity context; public HomeScreenAdapter1(Activity context, List<TableItem> items): base() { this.context = context; this.items = items; } public override long GetItemId(int position) { return position;//throw new NotImplementedException(); } public override TableItem this[int position] { get { return items[position]; } } public override int Count { get { return items.Count; } } public override View GetView(int position, View convertView, ViewGroup parent) { var item = items[position]; View view = convertView; if (view == null) // no view to re-use, create new view = context.LayoutInflater.Inflate(Resource.Layout.CustomView, null); view.FindViewById<TextView>(Resource.Id.Text1).Text = item.Heading; view.FindViewById<TextView>(Resource.Id.Text2).Text = item.SubHeading; view.FindViewById<ImageView>(Resource.Id.Image).SetImageResource(item.ImageResourceId); return view; }
it is showing error at TableItem word the type or namespace name 'TableItem' could not be found(are u missing a using directive or an assembly reference?) namespace EtSpSqlite { [Activity(Label = "HomeScreen1")] public class HomeScreen1 : Activity { ListView listView; protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); SetContentView(Resource.Layout.HomeScreen); listView = FindViewById<ListView>(Resource.Id.List); listView.Adapter = new HomeScreenAdapter(this, tableItems);//the name 'tableItems' does not exist in the current context listView.ItemClick += OnListItemClick; } protected void OnListItemClick(object sender, ItemClickEventArgs e) { //the type or namespace"ItemclickeventArgs could not found var listView = sender as ListView; var t = tableItems[e.Position]; Android.Widget.Toast.MakeText(this, t.Heading, Android.Widget.ToastLength.Short).Show(); } } } -- View this message in context: http://mono-for-android.1047100.n5.nabble.com/errors-in-Referencing-a-Custom-Row-View-in-listview-ex-tp5713019.html Sent from the Mono for Android mailing list archive at Nabble.com. _______________________________________________ Monodroid mailing list Monodroid@lists.ximian.com UNSUBSCRIBE INFORMATION: http://lists.ximian.com/mailman/listinfo/monodroid