switch / if statement, efficiency question

by Kent Yip » Thu, 30 Apr 2009 01:44:23 GMT

Sponsored Links
 a switch statement is made for nested if statements.

switch statement is greate if you have a bunch of selections, to make a
switch statement perform better you have to look at what user will likely
selection the most, and implement that case on the top most case in the
switch. Accessing that case will be faster than accessing cases at lower end
of the switch statement.


switch / if statement, efficiency question

by Kent Yip » Thu, 30 Apr 2009 04:35:45 GMT

 thx fadden for the info.


Sponsored Links

Other Threads

1. Which factor decide resource in folder 320x240 be used.

Please don't use the WxH configurations.  They were a bad idea that should
go away.

Consider the screen sizes that we could soon be dealing with:

320x240 low density
400x240 low density
480x320 medium density
640x480 medium density
800x480 high density
800x480 medium density
852x480 high density
852x480 medium density

And that is just the really common kinds of screens...

Dianne Hackborn
Android framework engineer

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

unsubscribe: android-porting+unsubscr...@googlegroups.com

2. How to detect the availability of networks programatically in andriod emulator?

Hi Roman,

Thanks for your useful information.
I will try 1st.


On Wed, Sep 9, 2009 at 7:22 AM, Roman ( T-Mobile USA) <


3. Getting Julian Date in Android


5. Feedback on my application

6. set text color for all guis within the task

7. iTunes for android...