2011年11月7日 星期一

[技術] R.drawable找不到ID的問題

1.圖檔必須是32 Bit , 不然adpt會編譯失敗..<==超機車 
單純只是搞錯目錄 , android 預設使用mdpi的目錄 , 一直修改hdip , 蠢斃了
使用openRawResource的做法

InputStream ins = getResources().openRawResource(R.raw.my_db_file);
int size = ins.available();
// Read the entire resource into a local byte buffer.
byte[] buffer = new byte[size];
ins.read(buffer);
ins.close();
FileOutputStream fos = new FileOutputStream("mycopy.db");
fos.write(buffer);
fos.close();
http://stackoverflow.com/questions/939170/resources-openrawresource-issue-android
http://blog.csdn.net/aomandeshangxiao/article/details/6654386

沒有留言:

張貼留言