private void MyList_ItemClick(object sender, AdapterView.ItemClickEventArgs e)
        {
            Toast.MakeText(this, "Clicked :" + Adapt.GetItemId(e.Position), ToastLength.Short).Show();
            int NumbPressed = (int)Adapt.GetItemId(e.Position);

            Toast.MakeText(this, "You Pressed : " + contactsPerson2[NumbPressed].FirstName, ToastLength.Short).Show();
            PictureID = imageIds[e.Position].DataSenderId;
            Action2();
        }
Exemplo n.º 2
0
        private void MyList_ItemClick(object sender, AdapterView.ItemClickEventArgs e)
        {
            receiverID = 0;
            Toast.MakeText(this, "Clicked :" + Cadapter.GetItemId(e.Position), ToastLength.Short).Show();
            int NumbPressed = (int)Cadapter.GetItemId(e.Position);

            Toast.MakeText(this, "You Pressed : " + contactsPerson2[NumbPressed].FirstName + contactsPerson2[NumbPressed].LastName, ToastLength.Short).Show();

            //string firstNameContact = contactsPerson2[NumbPressed].FirstName;
            //string lastNameContact = contactsPerson2[NumbPressed].LastName;

            //////////////////////////////////////////////////     third approach
            //for (int i = 0; i < deserializedFriends.Count; i++)
            //{
            //    if ((firstNameContact.ToString() + lastNameContact.ToString()) == (deserializedFriends[i].FirstName + deserializedFriends[i].LastName))
            //    {
            //        receiverID = deserializedFriends[i].PersonID;
            //    }
            //}
            //////////////////////////////////////////////////     end of third approach

            receiverID = deserializedFriends[e.Position].PersonID;

            if (receiverID != 0)
            {
                if (message)
                {
                    var intent = new Intent(this, typeof(ChatBubbleActivity));
                    intent.PutExtra("myID", myID);
                    intent.PutExtra("receiverID", receiverID);
                    StartActivity(intent);
                }
                if (photo)
                {
                    var intent = new Intent(this, typeof(ImagesActivity));
                    intent.PutExtra("myID", myID);
                    intent.PutExtra("receiverID", receiverID);
                    StartActivity(intent);
                }
                if (sendData)
                {
                    var intent = new Intent(this, typeof(SendDataActivity));
                    intent.PutExtra("myID", myID);
                    intent.PutExtra("receiverID", receiverID);
                    StartActivity(intent);
                }
                if (HealthHistory)   // mono otan syndethei giatros
                {
                    var intent = new Intent(this, typeof(History_ListviewActivity));
                    intent.PutExtra("myID", receiverID);
                    intent.PutExtra("receiverID", receiverID);
                    StartActivity(intent);
                }
                if (Allergy)   // mono otan syndethei giatros
                {
                    var intent = new Intent(this, typeof(AllergiesActivity));
                    intent.PutExtra("myID", receiverID);
                    intent.PutExtra("receiverID", receiverID);
                    StartActivity(intent);
                }
                if (newvisit)
                {
                    var intent = new Intent(this, typeof(NewVisitActivity));
                    intent.PutExtra("myID", myID);
                    intent.PutExtra("receiverID", receiverID);
                    StartActivity(intent);
                }
            }
        }