Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

Get Value form custom Adapterlist by clicking the value in the ListView

$
0
0

Hello,

I added my Adapterlist in a void like this:

public void AddMast();
    {
                var myMastListe = new List<MastDaten>();

                var myconnection = DriverManager.GetConnection("jdbc:hsqldb:file:" + myArbeitspakete[0].Pfad + "/andb", "sa", "1urJU8abMfjjprgaplYeD4b9");

                var mystatement = myconnection.CreateStatement();

                var myMastDaten = mystatement.ExecuteQuery("Select BW_ID, BW_ID_VORGAENGER, MAST_IST_MAST_NEBENLINIENSTART, MAST_ISTESRTESNEBLINIENELEMENT,MAST_ANZEIGENR,MAST_IST_MAST_0 From Mast order by BW_ID, BW_ID_VORGAENGER");

    while (myMastDaten.Next())
                    {
                        myMastListe.Add(new MastDaten {ID = myMastDaten.GetInt(1), MastTitle = myMastDaten.GetString(2),
                    }

    }

Now i want to get the value by the itemclick Listener:

        void myMastListe_ItemClick(object sender, AdapterView.ItemClickEventArgs e)
        {
            //
            Log.Info("Selectedmast", myMastListe[e.Position].MastTitle;
        }

But I only get following Exception:

System.NullReferenceException: Object reference not set to an instance of an object

What am I doing wrong?


Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>