Shouldn't your code read: descriptions[photoindex]?

Thanks,
Justin Anderson
MagouyaWare Developer
http://sites.google.com/site/magouyaware


On Sun, May 15, 2011 at 4:57 PM, Spooky <[email protected]> wrote:

> New question....
>
> I'm trying to access an array of text strings by its integer index (at
> laest, I think that's what I'm trying to do!).
>
> The array is defined as (it's actually longer than this---this is the
> shortened version):
>
>        String[] descriptions = {"Santa Rosa Sound (NW FL)",
>            "Sailboat on SR Sound", "SR Sound Sunset #1",
>            "SR Sound Sunset #2", "SR Sound Sunset #3",
>            "SR Sound Sunset #4", "NW FL Sunset",
>            "SR Sound from Okaloosa Island", "Beaches on the
> Island" );
>
> and I'm trying to use it, just a few lines later, like this
> (indentation
> shortened here):
>
>   TextView statusText = (TextView) findViewById(R.id.status_text);
>      statusText.setText(String.format("%s",
> descriptions(photoIndex)));
>
> I also tried this:
>
>   TextView statusText = (TextView) findViewById(R.id.status_text);
>      statusText.setText(descriptions(photoIndex));
>
> Eclipse insists on including an Object definition which merely
> returns null.  I tried editing it to return descriptions(photoIndex),
> and it Force Closed every time I tried to run it.  Obviously not the
> right way to do this.
>
> I *THINK* I'm following what an example shows to do, but I either get
> null or a Force Close.  The example is at:
>
>
> http://stackoverflow.com/questions/4986786/using-string-array-list-length-as-an-integer
>
> What I'm trying to do is access the descriptions array by the same
> index that the photo being loaded onto the screen is using.  The idea
> here is to replace the "1/39" with "Santa Rosa Sound (NW FL)".....
>
> Can anyone either let me know what I'm doing wrong, or point me to the
> appropriate FM that will show me how I *SHOULD* be doing it?  :-)
>
> --------------------------------
>
> Another question regarding image dimensions.  This app will be
> ad-supported, and in landscape mode, some of the photos take up the
> entire screen on my Android.  Will that block ads from being seen?
> Or is the container for this app reduced by the ads, thus reducing the
> parent to be filled by the photo to begin with?
>
> Thanks,
>   --jim
>
> PS:  Last newbie question from me today...follow-ups to this, yes, but
> another newbie question, not today......  If I get this working, I'm
> done
> for the day.  Then tomorrow, it's just cleaning up the screen...easy
> stuff.
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en

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

Reply via email to