Android MediaPlayer full path to file

前端 未结 3 1696
没有蜡笔的小新
没有蜡笔的小新 2021-02-04 22:23

I need to get the full path to a file somewhere on the phone (any location) and play it with MediaPlayer.

ive heard of using a file chooser for Android (by launching an

3条回答
  •  抹茶落季
    2021-02-04 23:02

    It seems you are calling prepare() twice, first in the constructor of AudioVideoEntry, and second in the method prepareMedia(), that's why it's giving an IllegalStateException.

    If you read carefully the documentation you can understand the State Diagram and why gives such exceptions.

提交回复
热议问题