为什么MediaExtractor getTrackCount的是Android 4.4.2返回0 [英] Why MediaExtractor getTrackCount returns 0 in android 4.4.2

查看:2171
本文介绍了为什么MediaExtractor getTrackCount的是Android 4.4.2返回0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我跑恰好在同一code:

I ran exactly the same code on:


  • 的Andr​​oid 4.1.2

  • 的Andr​​oid 4.2.2

  • 是Android 4.4.2。

它运作良好,在4.1.2和4.2.2,但是不能在4.4.2。

It works well on 4.1.2 and 4.2.2, but NOT on 4.4.2.

问题是 MediaExtractor.getTrackCount 在4.4.2返回0(当它返回在其他设备上正确的号码)

The problem is MediaExtractor.getTrackCount returns 0 on 4.4.2 (while it returns the right number on other devices)

任何想法?

我也面临着非常相同的问题。
你是否得到了解决?

I am also facing the very same issue. Did you got the solution ?

推荐答案

我终于想通了问题的所在。
对于4.4.2,你长了在AndroidManifest.xml中添加有关允许写外部存储,如果你播放本地文件。
这里是code
    

I finally figured out where the problem is. For 4.4.2, u got to add permission in the AndroidManifest.xml about write external storage if you play local file. here is the code

这篇关于为什么MediaExtractor getTrackCount的是Android 4.4.2返回0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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