0
ImageView img = new ImageView(getBaseContext());
img.setImageDrawable(Drawable.createFromPath(new File (newBA,"/thumbanil.png").toString()));
LinearLayout Previews = (LinearLayout)findViewById(R.id.Previews);
Previews.addView(img);
img.invalidate();
Previews.invalidate();
這個想法是從LinearLayout中的Drawable創建一個imageview。在LinearLayout中添加ImageView
但它不工作..代碼有什麼問題?
當拼寫文件'thumbnail.png'而不是'thumbanil.png'時會發生什麼? – Sam
...謝謝! – geecko