Click here to Skip to main content
15,901,035 members
Home / Discussions / Android
   

Android

 
GeneralRe: Plot Isobar n Google Map Api v2 Pin
ZurdoDev28-Oct-16 0:45
professionalZurdoDev28-Oct-16 0:45 
Questioncode android multiple table with insert, delete, update Pin
Member 1279832617-Oct-16 6:47
Member 1279832617-Oct-16 6:47 
AnswerRe: code android multiple table with insert, delete, update Pin
Richard MacCutchan17-Oct-16 7:54
mveRichard MacCutchan17-Oct-16 7:54 
AnswerRe: code android multiple table with insert, delete, update Pin
David Crow17-Oct-16 10:21
David Crow17-Oct-16 10:21 
GeneralOT Pin
Eytukan2-Dec-16 0:37
Eytukan2-Dec-16 0:37 
GeneralRe: OT Pin
David Crow2-Dec-16 5:52
David Crow2-Dec-16 5:52 
GeneralRe: OT Pin
Eytukan3-Dec-16 16:46
Eytukan3-Dec-16 16:46 
QuestionError Collection is of a fixed size Pin
Member 1129526527-Sep-16 16:13
Member 1129526527-Sep-16 16:13 
Hello Group
Now, I have a problem with a collection IList<>
My project use Web Service and the IList<> is fill with a web service, but when I try to delete one Item on IList<>, I get the error: Error Collection is of a fixed size. I have tried to fix this problem but I still can not. I need help !!!

C#
namespace MobileApplication
{
    public  partial class ListaCriteriosAdapter : BaseAdapter<Criterio>
    {
        IList<Criterio> ListaCriterios;
        private Context activity;
        private LayoutInflater MiInflanter;
        MobileService.MobileService Query = new MobileService.MobileService();

        public ListaCriteriosAdapter(Context context, IList<Criterio> MiLista)
        {
            this.activity = context;
            ListaCriterios = MiLista;
            MiInflanter = (LayoutInflater)activity.GetSystemService(Context.LayoutInflaterService);
        }

        public override int Count
        {
            get { return ListaCriterios.Count; }
        }

        public override long GetItemId(int position)
        {
            return position;
        }

        public override Criterio this[int position]
        {
            get { return ListaCriterios[position]; }
        }

        public override View GetView(int position, View convertView, ViewGroup parent)
        {
            ContactsViewHolder Holder = null;
            ImageView btnDelete;

            if (convertView == null)
            {
                convertView = MiInflanter.Inflate(Resource.Layout.ListViewCriterios, null);
                Holder = new ContactsViewHolder();

                Holder.txtFolio = convertView.FindViewById<TextView>(Resource.Id.TVFolioListaCriterios);
                Holder.txtCriterio = convertView.FindViewById<TextView>(Resource.Id.TVCriterioListaCriterios);
                Holder.txtTipo = convertView.FindViewById<TextView>(Resource.Id.TVTipoListaCriterios);
                btnDelete = convertView.FindViewById<ImageView>(Resource.Id.BTNBorrarCriterio);

                btnDelete.Click += (object sender, EventArgs e) =>
                {
                    AlertDialog.Builder builder = new AlertDialog.Builder(activity);
                    AlertDialog Confirm = builder.Create();

                    Confirm.SetTitle("Confirmar");
                    Confirm.SetMessage("Estas seguro de eliminarlo?");
                    Confirm.SetButton("Aceptar", (s, ev) =>
                    {
                        var Temp = (int)((sender as ImageView).Tag);
                        int id = (Int32)ListaCriterios[Temp].IdCriterio;

                        ListaCriterios.RemoveAt(Temp);

                        EliminarCriterioPP((Int32)id);
                        NotifyDataSetChanged();
                    });

                    Confirm.Show();

                };

                convertView.Tag = Holder;
                btnDelete.Tag = position;
            }
            else
            {
                btnDelete = convertView.FindViewById<ImageView>(Resource.Id.BTNBorrarCriterio);
                Holder = convertView.Tag as ContactsViewHolder;
                btnDelete.Tag = position;
            }

            Holder.txtFolio.Text = ListaCriterios[position].IdCriterio.ToString();
            Holder.txtCriterio.Text = ListaCriterios[position].DescripcionCriterio.ToString();
            Holder.txtTipo.Text = ListaCriterios[position].DescripcionGrafico;
            NotifyDataSetChanged();
            return convertView;
        }

        public class ContactsViewHolder : Java.Lang.Object
        {
            public TextView txtFolio { get; set; }
            public TextView txtCriterio { get; set; }
            public TextView txtTipo { get; set; }
        }

        private void EliminarCriterioPP(int Id)
        {
            Query.EliminarCriterioPPCompleted += Query_EliminarCriterioPPCompleted;
            Query.EliminarCriterioPPAsync(Id);
        }

        void Query_EliminarCriterioPPCompleted(object sender, System.ComponentModel.AsyncCompletedEventArgs e)
        {
            Toast.MakeText(activity, "Fue eliminado correctamente", ToastLength.Short).Show();
        }
    }
}

AnswerRe: Error Collection is of a fixed size Pin
Richard MacCutchan27-Sep-16 21:36
mveRichard MacCutchan27-Sep-16 21:36 
AnswerRe: Error Collection is of a fixed size Pin
Richard Deeming28-Sep-16 2:40
mveRichard Deeming28-Sep-16 2:40 
QuestionManage auto update Pin
Andy_Bell26-Sep-16 6:20
Andy_Bell26-Sep-16 6:20 
AnswerRe: Manage auto update Pin
Afzaal Ahmad Zeeshan26-Sep-16 6:50
professionalAfzaal Ahmad Zeeshan26-Sep-16 6:50 
GeneralRe: Manage auto update Pin
Andy_Bell28-Sep-16 10:31
Andy_Bell28-Sep-16 10:31 
QuestionMake a call from my contact list Pin
Member 1275186521-Sep-16 2:04
Member 1275186521-Sep-16 2:04 
AnswerRe: Make a call from my contact list Pin
Richard MacCutchan21-Sep-16 2:30
mveRichard MacCutchan21-Sep-16 2:30 
GeneralRe: Make a call from my contact list Pin
Member 1275186521-Sep-16 20:23
Member 1275186521-Sep-16 20:23 
GeneralRe: Make a call from my contact list Pin
Richard MacCutchan21-Sep-16 22:06
mveRichard MacCutchan21-Sep-16 22:06 
GeneralRe: Make a call from my contact list Pin
Member 1275186521-Sep-16 22:23
Member 1275186521-Sep-16 22:23 
QuestionRe: Make a call from my contact list Pin
David Crow21-Sep-16 6:32
David Crow21-Sep-16 6:32 
AnswerRe: Make a call from my contact list Pin
Member 1275186521-Sep-16 20:27
Member 1275186521-Sep-16 20:27 
QuestionRe: Make a call from my contact list Pin
David Crow22-Sep-16 2:23
David Crow22-Sep-16 2:23 
QuestionAndroid - Information leakage flaw OutputStream Pin
Member 1235809712-Sep-16 21:24
Member 1235809712-Sep-16 21:24 
QuestionRe: Android - Information leakage flaw OutputStream Pin
David Crow13-Sep-16 3:23
David Crow13-Sep-16 3:23 
AnswerRe: Android - Information leakage flaw OutputStream Pin
Afzaal Ahmad Zeeshan13-Sep-16 7:10
professionalAfzaal Ahmad Zeeshan13-Sep-16 7:10 
GeneralRe: Android - Information leakage flaw OutputStream Pin
Member 1235809720-Sep-16 20:56
Member 1235809720-Sep-16 20:56 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.