Tuesday, February 8, 2011

[android-developers] Re: Help with strings/arrays

A) Use reflection
B) There is this thing called polymorphism. Setup your array as
LevelHandler[] handlers = new LevelHandler[]{new Level0Handler(), new
Level1Handler(),...}

On 8 фев, 07:15, brian purgert <brianpurge...@gmail.com> wrote:
> this should be simple for you guys but i,ve always been lacking in knowledge
> in this area.
> I have a lvl select function where level[X] is the level pressed
> So when level[X] is pressed i want it to do a function in a diffrent class
> called public static void level[X] . The problem is, right now they are set
> up like public static void level1(),.... public static void level2(),.....
> and so on,
> so my question is how do i set up these functions so that i can use them in
> an array or string.
> Thank you any help is much appreciated.

--
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+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment