java - Array initialization in Android OS -


i in first phone development class using dhtml way when offered nextel. not date on going on or since then. creating simple text file driven quiz program using radio buttons.

so forcing myself write in java, load csv memory multi-dimensional array , loop through. talking 40 lines of text. question more integration of java phone, how occurs, , appropriate place load array prior execution of activitymain.xml? there flow chart how things execute through android?

if "load" mean initialize , give array values, can load array anywhere...maybe outside of method make member variable accessed throughout activity.

public class foodsearch extends activity {      string[] questions = new string[40];  // want create array      // add values if want here      public void oncreate(bundle bundle)      {            // code 

but can't use contents in view until have called setcontentveiw(). if post of code how doing can better you

public void oncreate(bundle bundle) {      super.oncreate(bundle);      setcontentview(r.layout.yourlayout);      // can access views "load" array } 

Comments

Popular posts from this blog

Detect support for Shoutcast ICY MP3 without navigator.userAgent in Firefox? -

web - SVG not rendering properly in Firefox -

java - JavaFX 2 slider labelFormatter not being used -