我试图MP3文件保存到我的应用程序文件夹res/raw/
,但我不知道actualy如何做到这一点..任何MP3文件保存到我的应用程序
当按钮clicked
OnClickListener button2 = new OnClickListener(){
@Override
public void onClick(View v) {
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
intent.setType("file/*");
int YOUR_RESULT_CODE = 0;
intent.getData();
startActivityForResult(intent, YOUR_RESULT_CODE);
}
};
那是因为我想用一个文件浏览器来选择我的.MP3文件类型
现在,我怎么选择文件保存到特定的文件夹(RES/RAW)into
我application
public File getTempFile(Context context, String url) {
//should i add something here?
File file1 = null;
try {
String FileName = Uri.parse(url).getLastPathSegment();
file1 = File.createTempFile(FileName, null, context.getCacheDir());
}
catch (IOException e) {
}
return file1;
}
我将非常感激,如果你的例子预先包含:) code
感谢
ü意味着你刚刚想从一个文件夹复制MP3文件在乌拉圭回合应用amother? – KOTIOS
从SD卡(或手机内存)到我的应用程序文件夹 – noobProgrammer
好吧你的意思断言文件夹? – KOTIOS