Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6752301
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T13:01:43+00:00 2026-05-26T13:01:43+00:00

I have many .mp3 files stored in res/raw folder. I am getting URI of

  • 0

I have many .mp3 files stored in res/raw folder.

I am getting URI of .mp3 file using following code.

Uri.parse("android.resource:///com.my.android.sharesound/"+resId);

This returns : android.resource:///com.my.android.sharesound/2130968609

Now I am using this URI in creating Share Intent

    shareIntent.putExtra(Intent.EXTRA_STREAM,Uri.parse("android.resource://com.my.android.sharesound/"+resId));
    startActivity(Intent.createChooser(shareIntent,"Share Sound");

When i select any Mail application eg. Gmail or YahooMail from the Share Intent, the mp3 file attached successfully. But it shows that 2130968609(as an attachment)

i dont want resourceId(2130968609) to appear.

I want to display fileName.mp3

How can i do that? Am i missing something ?

OR

Is there any other way to attach .mp3 file stored in res/raw to mail via Share Intent.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T13:01:43+00:00Added an answer on May 26, 2026 at 1:01 pm

    Finally after searching a lot i found the solution.

    If you want to get any resource URI then there are two ways :

    1. Using Resource Name

      Syntax : android.resource://[package]/[res type]/[res name]

      Example : Uri.parse("android.resource://com.my.package/drawable/icon");

    2. Using Resource Id

      Syntax : android.resource://[package]/[resource_id]

      Example : Uri.parse("android.resource://com.my.package/" + R.drawable.icon);

    This were the examples to get the URI of any image file stored in drawable folder.

    Similarly you can get URIs of res/raw folder.

    In my case i used 1st way ie. Using Resource Name

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have many different NSArray 's stored in .dat files, in the Documents folder
I have many mp3 files stored on my server already from a static website,
I have many many files in a folder, and I want to process them
How to concat many (say 500) mp3 files into one file (any type) and
I have links to mp3 files on my website (normal <a href=file.mp3> tags). But
I have a piece of code that generates a class, Id3v1Tag, using a file
I have such code (for example): <script> $('audio').mediaelementplayer(); </script> <audio id=mejs controls=controls> <source src=/media/file-2.mp3
Hi I have a locally stored 5:00 minutes mp3 files in my iPhone app.
I have a folder with many files of different types. I need to display
I have many directories with files in them. I want to create a comma

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.