可以從資源傳遞給R.的圖像加載一個String。可以從傳遞String參數的資源加載R.drawable?
我想這一點:
public static Bitmap LoadBitmap(Context context, String filename)
{
Bitmap image;
image = BitmapFactory.decodeResource(context.getResources(), R.drawable.filename);
return image;
}
拋出以下錯誤:
filename cannot be resolved or is not a field
我試圖創建R檔creatic恆定的場,而拋出下面一行:
R.java was modified manually! Reverting to generated version!
我會感謝您的幫助或建議。謝謝
你能不能舉個例子嗎?我可以用inputstream來做嗎?謝謝 – karse23 2011-03-06 17:30:15