问题在android的创建临时文件? [英] Problem in creating Temporary File in android?

查看:256
本文介绍了问题在android的创建临时文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的流媒体视频我用下面的code MediaPlayer的应用

In my MediaPlayer application for streaming Video i am using the following code

File temp = File.createTempFile("mediaplayertmp", "dat");

在运行它引发异常像

while running it throws exceptions like

Parent directory of file in not 
writable:/sdcard/
mediaplayertmp43912.dat

我不如何处理这个问题,我想知道,当我们执行了code意味着该文件将created.any人知道的解决方案意味着,请用一些code帮助。

I dont how to handle this problem,and i want to know that when we execute that code means where the file will be created.any one knows the solution means please help with some code.

推荐答案

请问您的要求写入权限在android清单中的SD卡?

Does your request permission to write to the SD Card in the android manifest?

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

这篇关于问题在android的创建临时文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆