2012-02-10 1 views
-1

私はこの配列をループするので、100行のイメージを書き出す必要はありません。私はあなたがAndroidループイメージ

String[] pics = new String[6]; 

// Fill it like this 
for(int i=0; i<pics.length; i++) { 
    pics[i] = Constants.BASE_URL+"/bg/a/A" + (i+1) + ".jpg"; 
} 

// To traverse it 
for(String picName : pics) { 
    // picName contains the name 
} 

を配列を使用している場合、それは私はあなたが探して、この何を期待

private String[] pics = { 
//want to loop these 
     Constants.BASE_URL+"/bg/a/A1.jpg", 
     Constants.BASE_URL+"/bg/a/A2.jpg", 
     Constants.BASE_URL+"/bg/a/A3.jpg", 
     Constants.BASE_URL+"/bg/a/A4.jpg", 
     Constants.BASE_URL+"/bg/a/A5.jpg", 
     Constants.BASE_URL+"/bg/a/A6.jpg", 
// 
     }; 
+0

for(int i = 0; i

答えて

1

simmple知っています。

関連する問題