Saturday 15 January 2011

java - Using strings from an array, not working to element? -


Pretty new here in Java is a very easy problem but in reality it does not understand what the problem is ...

I have an array with strings. Array Elements are url images I have a visual element that is changing the images. I need to set the image with an element from the array.

  imageSwitcher.setImageUrl (last_imes [1] .toString ()); Log.d ("D1", Last_images [1] .toString ());   

In the first line if I'm doing it for example "www.example.com/1.jpg" However, when I do not work on the array element it is showing the correct url in the log. Cat ...

On in Crete I have: Last_images = new string [10]; And in class values ​​I have: String [] Last_images = null;

Coming from PHP and I'm really confused why this is not working and I actually find it a little easier.

Last_images can be taped: In my opionion you should do something like this: < Pre> if (Last_images! = Null & amp; amp; & amp; amp; e-commerce [i]! = Null) {imageSwitcher.setImageUrl (last_imes [1]); }

No comments:

Post a Comment