Click here to Skip to main content
13,042,630 members (79,550 online)
Rate this:
Please Sign up or sign in to vote.
See more:
package manish.yadav;
import java.util.ArrayList;
import java.util.HashMap;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ListAdapter;
import android.widget.ListView;
import android.widget.SimpleAdapter;
public class recorded_audiofiles extends ListActivity {
	// Songs list
	public ArrayList<HashMap<String, String>> songsList = new ArrayList<HashMap<String, String>>();
	public void onCreate(Bundle savedInstanceState) {
		ArrayList<HashMap<String, String>> songsListData = new ArrayList<HashMap<String, String>>();
		audio_recorder_manager plm = new audio_recorder_manager();
		// get all songs from sdcard
		this.songsList = plm.getPlayList();
		// looping through playlist
		for (int i = 0; i < songsList.size(); i++) {
			// creating new HashMap
			HashMap<String, String> song = songsList.get(i);
			// adding HashList to ArrayList
		// Adding menuItems to ListView
		ListAdapter adapter = new SimpleAdapter(this, songsListData,
				R.layout.playlist_item, new String[] { "songTitle" }, new int[] { });
		// selecting single ListView item
		ListView lv = getListView();
		// listening to single listitem click
		lv.setOnItemClickListener(new OnItemClickListener() {
			public void onItemClick(AdapterView<?> parent, View view,
					int position, long id) {
				// getting listitem index
				int songIndex = position;
				// Starting new intent
				Intent in = new Intent(getApplicationContext(),
				// Sending songIndex to PlayerActivity
				in.putExtra("songIndex", songIndex);
				setResult(100, in);
				// Closing PlayListView

//Any suggestions would Be Greatly Helpful
Posted 8-Jan-13 19:21pm
Updated 5-Feb-13 20:33pm
Sandeep Mewara 9-Jan-13 3:03am
You need to clearly mention what issue are you facing while trying ?
Manish Yadav 9-Jan-13 3:10am
I m not getting any error but i want to use audio player when any file is clicked Plz suggest any solution
Manish Yadav 6-Feb-13 2:11am
Can i share u the whole code :)
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

Well to start with you can look for media player class on android developer site and more you can find on where in there is example of music player...hope this will solve your problem
Manish Yadav 6-Feb-13 2:16am
I have tried .mp4 files(i.e) the recorded files are showing in the array list but how to trigger the intent for playing them (Plz help me)

Thanx in Advance
Manish Yadav 6-Feb-13 2:18am
I m not doing the mp3 player bro i m working with the audio recorder with format (.mp4 & .3gp) PLZ HELP me
Manish Yadav 6-Feb-13 2:35am
here is the link--->

plz share ur ideas to improve it
Rate this: bad
Please Sign up or sign in to vote.

Solution 3

I think in your PlayActivity you maybe write this code get the songIndex in your function onActivityResult(...)
Intent in = data;
int songIndex = in.getIntExtra("songIndex", -1);

So you can pass this songIndex to the formatActivity by Intent ,I think you maybe use the String[] filePath to find the file the filePath[songIndex] find the file in Sdcard
in formatActivity So you can Format it.

hope this will solve your problem.

by the way.
find a job in New York.
I have 3 year Experience about andorid.
And have few Experience about game server
in MS 2005 server C++.
Manish Yadav 12-Feb-13 6:39am
Thanx Steven i will try this may it helps :)
Manish Yadav 12-Feb-13 6:40am
@Steven--->What the job are you talking about?
Contact me on

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170713.1 | Last Updated 7 Feb 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100