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 4252810
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T04:51:58+00:00 2026-05-21T04:51:58+00:00

I am trying to pick a song using an Activity which will give meta-information

  • 0

I am trying to pick a song using an Activity which will give meta-information about the songs. I want to do this instead of a simple file browser . I have the following code but it unfortunately also plays the song once clicked. I simply want the user to be able to select a song from their MediaStore and act upon it later without playing.

public class Main extends Activity {
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        Intent intent = new Intent();
        intent.setAction(android.content.Intent.ACTION_PICK);
        intent.setData(MediaStore.Audio.Media.EXTERNAL_CONTENT_URI);
        startActivity(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-21T04:51:58+00:00Added an answer on May 21, 2026 at 4:51 am

    As far as I can tell, the ‘picker’ you’re seeing is a ‘preview’ type of design (looking at it on my phone).

    It’s a bit like ‘picking’ a ringtone, for example…

    You see a list and can select each one in turn to get a ‘preview’. When you decide on the ringtone you want, you click OK and that returns the selection. Clicking Cancel simply leaves things as they were (existing ringtone selection is kept).

    I can’t see any way of overriding this behaviour of the picker and haven’t found any alternative way (Intent parameters, for example) to achieve what you want to do.

    In other words, as I understand it, you simply want the user to silently pick a piece of music and it to return to your Activity but the (preview) picker doesn’t work that way.

    You can find out what the user previewed/selected when they click OK in the picker however, if you use…

    startActivityForResult(intent, 1234);
    

    Note, 1234 is just an arbitrary code.

    If you check the Intent returned to onActivityResult() it will have the content Uri of the piece of music the user selected before they pressed OK.

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

Sidebar

Related Questions

I am trying to bundle my tests in a TestSuite which will pick up
I'm trying to create a program with some key bindings (F1-F12) which will pick
OK, this is minefield, but trying to understand why one would pick .NET (or
What is the pythonic way to perform this loop. I'm trying to pick a
On iOS 5 using an iPhone 4s I am trying to pick a photo
I am trying to pick, using Jsoup, the paragraph inside the following HTML snippet:
I'm trying to create a regular expression that will pick the longest of two
I currently trying to decide which embedded database to pick up for new .NET
I'm trying to run an Icecast stream using a simple Python script to pick
I am struggling trying to pick apart the OAuth Service Provider example which is

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.