Hi Experts,

I am trying to optimize the following code:

                          textview[0]=(TextView)findViewById
(R.id.TextView1);
                  textview[1]=(TextView)findViewById(R.id.TextView2);
                  textview[2]=(TextView)findViewById(R.id.TextView3);
                  textview[3]=(TextView)findViewById(R.id.TextView4);
                  textview[4]=(TextView)findViewById(R.id.TextView5);
                  textview[5]=(TextView)findViewById(R.id.TextView6);
                  textview[6]=(TextView)findViewById(R.id.TextView7);
                  textview[7]=(TextView)findViewById(R.id.TextView8);
                  textview[8]=(TextView)findViewById(R.id.TextView9);
                  textview[9]=(TextView)findViewById(R.id.TextView10);

using:

int j;
for(int i=0;i<10;i++)
{
                                   j = i+1;
                           textViewId = "TextView"+j;
                           textview[i] = 
(TextView)findViewById(R.id.textViewId);//
error textViewId not recognized
}

but this is giving error at the last line.. Can you please help me to
come out of this.

Thanks in advance.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to