1
我創建了一個android應用程序,我用相機捕獲圖像並上傳到服務器。我有一個圖像listView,我正在顯示圖像。但是listView總是顯示圖標圖像。我測試了服務器映像,圖像始終在上傳,但不顯示listview。爲什麼android應用程序顯示應用程序圖標而不是我上傳的圖像?
我創建了一個android應用程序,我用相機捕獲圖像並上傳到服務器。我有一個圖像listView,我正在顯示圖像。但是listView總是顯示圖標圖像。我測試了服務器映像,圖像始終在上傳,但不顯示listview。爲什麼android應用程序顯示應用程序圖標而不是我上傳的圖像?
我用來加載圖像的三種方法如下。
private Drawable ImageOperations(String url, String saveFilename) {
try {
InputStream is = (InputStream) this.fetch(url);
Drawable d = Drawable.createFromStream(is, "src");
return d;
} catch (MalformedURLException e) {
return null;
} catch (IOException e) {
return null;
}
}
public Object fetch(String address) throws MalformedURLException,
IOException {
URL url = new URL(address);
Object content = url.getContent();
return content;
}
public int getCount() {
// TODO Auto-generated method stub
int sizef=items.size();
Log.i("Size", sizef+"");
return items.size();
}
但現在如何加載圖像,因爲服務器現在從Get方法更改爲Post方法。 使用https的服務器: