單純只是搞錯目錄 , 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
沒有留言:
張貼留言