2011-10-17 60 views
1

我正在製作一個android應用程序,我需要使用以下代碼在我的應用程序中顯示遠程圖像 。 但不被顯示的圖像:android:不顯示圖像

for(int i=0;i<stringOnTextView.length;i++){ 
    imageUrl = "http://ondamove.it/English/images/users/"; 
    imageUrl = imageUrl+stringOnTextView[i]; 
    System.out.println(imageUrl); 

    URL myFileUrl = new URL(imageUrl); 

    HttpURLConnection conn= (HttpURLConnection)myFileUrl.openConnection(); 
    conn.setDoInput(true); 
    conn.connect(); 
    InputStream is = conn.getInputStream(); 
    bmImg = BitmapFactory.decodeStream(is); 
    image.setImageBitmap(bmImg); 
    System.out.println(bmImg.toString()); 
} 

誰能告訴我問題出在哪裏。感謝

+0

的System.out.println(bmImg) ;打印null或不? –

+0

不是它打印[email protected] – ekjyot

+0

比任何錯誤的問題? –

回答

1

爲我的評論的完成,看到這三個教程,你會發現,你應該做的:):

tuto1
tuto2
tuto3