can not play mp3 files which have spaces between strings on a Lenovo Device (Android)

*爱你&永不变心* 提交于 2019-12-13 05:31:37

问题


I working on an Android App which should play different audio files (mp3) onClick.

Some of the files have longer strings with spaces between the words, e.g:

1. path/dir1/dir2/this is a song.mp3
2. path/dir1/dir2/this.mp3

so if the user clicks on the play button and the chosen file exists in the database, it runs the path. All the devices can run number 2 without any problem. That is, files which do not contain any spaces between words.

Other devices are able to play any kind, that is both 1 & 2. (e.g. Motorola Moto C Plus Android 7.0, Acer Tablet B1-730HD Android 4.4.2)

The problem is with one device I've checked (Levono C2 Model 2016, Android 6.0), it can only play the second one and doesn't recognize such with spaces (No. 1)

So my question is:

did anyone encounter this problem, and if yes, is that a specific bug which exists only for Levono phones? or is this something that can somehow be changed over settings or programming? or in the worst case, do I have modify all the thousands files in database and file manager to have '_' between the words?

any help is appreciated!

P.S Im using Android Studio 3.1.3 for running the mp3s I use:

player = new MediaPlayer();
player.setDataSource(....);

来源:https://stackoverflow.com/questions/52243793/can-not-play-mp3-files-which-have-spaces-between-strings-on-a-lenovo-device-and

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!