首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > Android >

找不到sdcard的图片解决方法

2012-04-22 
找不到sdcard的图片public void onClick(View v){Intent intent new Intent(Intent.ACTION_VIEW)Uri mU

找不到sdcard的图片

public void onClick(View v) 
  {  
  Intent intent = new Intent(Intent.ACTION_VIEW);
  Uri mUri = Uri.parse("file://" + "mnt/sdcard");
  intent.setDataAndType(mUri, "image/*");
  startActivity(intent);
  }
调用系统自带的图片浏览器的时候导入sdcard的图片在模拟器中找不到,是什么原因啊,求大侠指点...

[解决办法]
我晕,sdcard的路径不是这样写的
正确写法是,
String localPath = Environment.getExternalStorageDirectory().getAbsoluteFile()
.getAbsolutePath();
得到sdcard的绝对路径

热点排行