hmk
hmk

Reputation: 11

How to read raw folder file name which has space between words

I have a few mp3 files in raw folder in which some of the file name have two words.I mean space between the words.Please help me how to read the file name.

Upvotes: 0

Views: 335

Answers (1)

Karo Hovhannisyan
Karo Hovhannisyan

Reputation: 104

That's not a valid resource naming. Replace all spaces with underline character (_):

Original - original file name.mp3

Changed - original_file_name.mp3

This will allow you to access that file through Resources.openRawResource() API.

Upvotes: 2

Related Questions