Id creation for Dynamically created TextView

I have created TextViews dynamically i want to create id's for those textviews.
Here is my code

        int n = 5;
        TextView[] myTextViews = new TextView[n];

        for (int i = 0; i < n; i++) 
        {
            textView = new TextView(this);
            textView.TextSize = float.Parse("25");
            textView.Gravity = GravityFlags.Center;
            textView.SetWidth (70);
            textView.SetHeight (70);
            switch (i) {
            case 0:
                textView.Id = Resource.Id.passCodeBox1;
                break;
            case 1:
                textView.Id = Resource.Id.passCodeBox2;
                break;
            case 2:
                textView.Id = Resource.Id.passCodeBox3;
                break;
            case 3:
                textView.Id = Resource.Id.passCodeBox4;
                break;
            case 4:
                textView.Id = Resource.Id.passCodeBox5;
                break;
            case 5:
                textView.Id = Resource.Id.passCodeBox6;
                break;
        }
            textView.SetFilters( new IInputFilter[] { new InputFilterLengthFilter(1) } );
            textView.SetRawInputType (InputTypes.TextVariationPassword);
            textView.SetBackgroundResource (Resource.Drawable.passcodeBorder);
            passcodeBoxlayout.AddView(textView);
            myTextViews[i] = textView;
        } 

above create id's are working for only one textview. I would like to create id for each textview.

can any one help me.....
thanks in advance...

Tagged:
Sign In or Register to comment.