[android-beginners] Re: Why does this give an error.

2009-04-16 Thread Kevin J. Brooks
I found the problem. I had it inside one of the methods of the class. Thanks for the help. On Wed, 2009-04-15 at 16:57 -0700, fadden wrote: > On Apr 15, 4:37 pm, "Kevin J. Brooks" > wrote: > > I took out the key word static and fixed the problem. > > You now have a different string array in ev

[android-beginners] Re: Why does this give an error.

2009-04-16 Thread deepdr...@googlemail.com
Yes, sure, "static" can only be used in classes, not inside of functions. As "static" denotes a class variable in contrast to an instance variable. A variable declared "static" exists only once for all instances of one class. So leaving the static out gives it a different meaning too. -- http://

[android-beginners] Re: Why does this give an error.

2009-04-16 Thread Yusuf T. Mobile
I got the same "illegal modifier for strSheikResp" error from Eclipse when I put it inside a function, but no error when I put it inside a class but outside of a function. static final String[] strSheikResp = new String[]{"open sesame"}; Where did you put the declaration? Yusuf Saib An

[android-beginners] Re: Why does this give an error.

2009-04-15 Thread fadden
On Apr 15, 4:37 pm, "Kevin J. Brooks" wrote: > I took out the key word static and fixed the problem. You now have a different string array in every instance of the class, instead of one for all instances of the class. How does Eclipse feel about: static final String[] strSheikResp = {"test

[android-beginners] Re: Why does this give an error.

2009-04-15 Thread Kevin J. Brooks
I took out the key word static and fixed the problem. On Wed, 2009-04-15 at 18:57 -0400, Kevin J. Brooks wrote: > Yes it is Eclipse giving the error and your assumption is correct. > > On Wed, 2009-04-15 at 10:15 -0700, deepdr...@googlemail.com wrote: > > Does Eclipse show you that error? Or wha

[android-beginners] Re: Why does this give an error.

2009-04-15 Thread Kevin J. Brooks
Yes it is Eclipse giving the error and your assumption is correct. On Wed, 2009-04-15 at 10:15 -0700, deepdr...@googlemail.com wrote: > Does Eclipse show you that error? Or what compiler do you use? I do > not get any error from a line like > > static final String[] strSheikResp = new String[]{"

[android-beginners] Re: Why does this give an error.

2009-04-15 Thread deepdr...@googlemail.com
Does Eclipse show you that error? Or what compiler do you use? I do not get any error from a line like static final String[] strSheikResp = new String[]{"test1", "test2"}; (assuming you do not mean the "" literally) -- http://www.deepdroid.com On Apr 15, 2:15 am, "Kevin J. Brooks" wrote