I am creating expandable listview like this image so many tables, when i click any one show its child my questions how to create database just show only 1 like computer electronic when click on that tap show its childs i found this tutorial is use hardcode data plz how can i used sqlite database for expandablelistview?
public class MainActivity extends Activity {
ExpandableListAdapter listAdapter;
ExpandableListView expListView;
List<String> listDataHeader;
HashMap<String, List<String>> listDataChild;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
// get the listview
expListView = (ExpandableListView) findViewById(R.id.lvExp);
// preparing list data
prepareListData();
listAdapter = new ExpandableListAdapter(this, listDataHeader, listDataChild);
// setting list adapter
expListView.setAdapter(listAdapter);
// Listview Group click listener
expListView.setOnGroupClickListener(new OnGroupClickListener() {
#Override
public boolean onGroupClick(ExpandableListView parent, View v,
int groupPosition, long id) {
// Toast.makeText(getApplicationContext(),
// "Group Clicked " + listDataHeader.get(groupPosition),
// Toast.LENGTH_SHORT).show();
return false;
}
});
// Listview Group expanded listener
expListView.setOnGroupExpandListener(new OnGroupExpandListener() {
#Override
public void onGroupExpand(int groupPosition) {
Toast.makeText(getApplicationContext(),
listDataHeader.get(groupPosition) + " Expanded",
Toast.LENGTH_SHORT).show();
}
});
// Listview Group collasped listener
expListView.setOnGroupCollapseListener(new OnGroupCollapseListener() {
#Override
public void onGroupCollapse(int groupPosition) {
Toast.makeText(getApplicationContext(),
listDataHeader.get(groupPosition) + " Collapsed",
Toast.LENGTH_SHORT).show();
}
});
// Listview on child click listener
expListView.setOnChildClickListener(new OnChildClickListener() {
#Override
public boolean onChildClick(ExpandableListView parent, View v,
int groupPosition, int childPosition, long id) {
// TODO Auto-generated method stub
Toast.makeText(
getApplicationContext(),
listDataHeader.get(groupPosition)
+ " : "
+ listDataChild.get(
listDataHeader.get(groupPosition)).get(
childPosition), Toast.LENGTH_SHORT)
.show();
return false;
}
});
}
/*
* Preparing the list data
*/
private void prepareListData() {
listDataHeader = new ArrayList<String>();
listDataChild = new HashMap<String, List<String>>();
// Adding child data
listDataHeader.add("Top 250");
listDataHeader.add("Now Showing");
listDataHeader.add("Coming Soon..");
// Adding child data
List<String> top250 = new ArrayList<String>();
top250.add("The Shawshank Redemption");
top250.add("The Godfather");
top250.add("The Godfather: Part II");
top250.add("Pulp Fiction");
top250.add("The Good, the Bad and the Ugly");
top250.add("The Dark Knight");
top250.add("12 Angry Men");
List<String> nowShowing = new ArrayList<String>();
nowShowing.add("The Conjuring");
nowShowing.add("Despicable Me 2");
nowShowing.add("Turbo");
nowShowing.add("Grown Ups 2");
nowShowing.add("Red 2");
nowShowing.add("The Wolverine");
List<String> comingSoon = new ArrayList<String>();
comingSoon.add("2 Guns");
comingSoon.add("The Smurfs 2");
comingSoon.add("The Spectacular Now");
comingSoon.add("The Canyons");
comingSoon.add("Europa Report");
listDataChild.put(listDataHeader.get(0), top250); // Header, Child data
listDataChild.put(listDataHeader.get(1), nowShowing);
listDataChild.put(listDataHeader.get(2), comingSoon);
}
}
In your prepareListData()
// Adding child data
List<String> top250 = getTop250();
public List<String> getTop250() {
List<String> top250List = new ArrayList<String>();
// Select All Query
String selectQuery = "SELECT * FROM " + TABLE_CONTACTS;
SQLiteDatabase db = this.getWritableDatabase();
Cursor cursor = db.rawQuery(selectQuery, null);
// looping through all rows and adding to list
if (cursor.moveToFirst()) {
do {
// Adding contact to list
top250List.add(cursor.getString(0));
} while (cursor.moveToNext());
}
// return top 250 list
return top250List;
}
similarly get other lists and add it to child, hope this helps and for CURD in sqlite DB look here
Related
So I am having an expandable listview. What I want is to make clickable each children. If I press the first one I want to open the class1, if I press the second one I want to open the class2, if I press the third one I want to open the class3 and so on... I am new in programming so please explain me like you would do it for a dummy.
I am getting this error message
The constructor Intent(new ExpandableListView.OnChildClickListener(){}, Class<Men>) is undefined
Source Code
package info.androidhive.expandablelistview;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ExpandableListView;
import android.widget.ExpandableListView.OnChildClickListener;
import android.widget.ExpandableListView.OnGroupClickListener;
import android.widget.ExpandableListView.OnGroupCollapseListener;
import android.widget.ExpandableListView.OnGroupExpandListener;
import android.widget.Toast;
public class MainActivity extends Activity {
ExpandableListAdapter listAdapter;
ExpandableListView expListView;
List<String> listDataHeader;
HashMap<String, List<String>> listDataChild;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
// get the listview
expListView = (ExpandableListView) findViewById(R.id.lvExp);
// preparing list data
prepareListData();
listAdapter = new ExpandableListAdapter(this, listDataHeader, listDataChild);
// setting list adapter
expListView.setAdapter(listAdapter);
// Listview Group click listener
expListView.setOnGroupClickListener(new OnGroupClickListener() {
#Override
public boolean onGroupClick(ExpandableListView parent, View v,
int groupPosition, long id) {
// Toast.makeText(getApplicationContext(),
// "Group Clicked " + listDataHeader.get(groupPosition),
// Toast.LENGTH_SHORT).show();
return false;
}
});
// Listview Group expanded listener
expListView.setOnGroupExpandListener(new OnGroupExpandListener() {
#Override
public void onGroupExpand(int groupPosition) {
//Toast.makeText(getApplicationContext(),
//listDataHeader.get(groupPosition) + " Expanded",
//Toast.LENGTH_SHORT).show();
}
});
// Listview Group collasped listener
expListView.setOnGroupCollapseListener(new OnGroupCollapseListener() {
#Override
public void onGroupCollapse(int groupPosition) {
//Toast.makeText(getApplicationContext(),
//listDataHeader.get(groupPosition) + " Collapsed",
//Toast.LENGTH_SHORT).show();
}
});
// Listview on child click listener
expListView.setOnChildClickListener(new OnChildClickListener() {
#Override
public boolean onChildClick(ExpandableListView parent, View v,
int groupPosition, int childPosition, long id) {
// TODO Auto-generated method stub
//Toast.makeText(
//getApplicationContext(),
// listDataHeader.get(groupPosition)
// + " : "
// + listDataChild.get(
// listDataHeader.get(groupPosition)).get(
// childPosition), Toast.LENGTH_SHORT)
//.show();
switch( childPosition )
{
case 0: Intent Men = new Intent(this, Men.class);
startActivity(Men);
break;
case 1: Intent newActivity2 = new Intent(this, youtube.class);
startActivity(newActivity2);
break;
case 2: Intent newActivity1 = new Intent(this, olympiakos.class);
startActivity(newActivity1);
break;
case 3: Intent newActivity3 = new Intent(this, karaiskaki.class);
startActivity(newActivity3);
break;
case 4: Intent newActivity4= new Intent(this, reservetickets.class);
startActivity(newActivity4);
break;
}
return false;
}
});
}
/*
* Preparing the list data
*/
private void prepareListData() {
listDataHeader = new ArrayList<String>();
listDataChild = new HashMap<String, List<String>>();
// Adding child data
listDataHeader.add("Top 250");
listDataHeader.add("Now Showing");
listDataHeader.add("Coming Soon..");
// Adding child data
List<String> top250 = new ArrayList<String>();
top250.add("The Shawshank Redemption");
top250.add("The Godfather");
top250.add("The Godfather: Part II");
top250.add("Pulp Fiction");
top250.add("The Good, the Bad and the Ugly");
top250.add("The Dark Knight");
top250.add("12 Angry Men");
List<String> nowShowing = new ArrayList<String>();
nowShowing.add("The Conjuring");
nowShowing.add("Despicable Me 2");
nowShowing.add("Turbo");
nowShowing.add("Grown Ups 2");
nowShowing.add("Red 2");
nowShowing.add("The Wolverine");
List<String> comingSoon = new ArrayList<String>();
comingSoon.add("2 Guns");
comingSoon.add("The Smurfs 2");
comingSoon.add("The Spectacular Now");
comingSoon.add("The Canyons");
comingSoon.add("Europa Report");
listDataChild.put(listDataHeader.get(0), top250); // Header, Child data
listDataChild.put(listDataHeader.get(1), nowShowing);
listDataChild.put(listDataHeader.get(2), comingSoon);
}
You dont have any Men class in your application. Thats why its showing error. See for the correct class name. Again for your convenience use a different intent name
case 0: Intent goactivity = new Intent(youractivity.this, men.class);
startActivity(goactivity);
//as your coding looks looks like may be your class is **men** not **Men**
Again if it is Men check if that extends Activity or not
It is basically because when you refer to this within a OnChildClickListener, it refers to the OnChildClickListener, not the Activity. Try using MainActivity.this instead. Or you can use view.getContext(). Both will give you the proper context.
This is my Activity I used to display my items in Expandable List View. At the moment I have hard coded the values which should come to the Expandable List View.
String subTotal = getIntent().getStringExtra("subTotal"); // I have these 2 values
String price = getIntent().getStringExtra("price");
These are the 2 values I wanna load dynamically.
In the below I have prepareListData(), where I have hard coded values to my ExpandableListView.
listDataHeader.add("Top 250"); // subTotal
List<String> top250 = new ArrayList<String>();
top250.add("The Shawshank"); //price
I want to know how to replace these hard coded values with my dynamic values. Any help would be highly appreciated.
#Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.cart_activity);
String subTotal = getIntent().getStringExtra("subTotal"); // i ahve these 2 values
String price = getIntent().getStringExtra("price");//
ActionBar actionBar = getActionBar();
getActionBar().setIcon(
new ColorDrawable(getResources().getColor(android.R.color.transparent)));
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN);
// Enabling Back navigation on Action Bar icon
actionBar.setDisplayHomeAsUpEnabled(true);
// get the listview
expListView = (ExpandableListView) findViewById(R.id.lvExp);
// preparing list data
prepareListData();
listAdapter = new ExpandableListAdapter(this, listDataHeader, listDataChild);
// setting list adapter
expListView.setAdapter(listAdapter);
// Listview Group click listener
expListView.setOnGroupClickListener(new OnGroupClickListener() {
#Override
public boolean onGroupClick(ExpandableListView parent, View v,
int groupPosition, long id) {
Toast.makeText(getApplicationContext(),
"Group Clicked " + listDataHeader.get(groupPosition),
Toast.LENGTH_SHORT).show();
return false;
}
});
// Listview Group expanded listener
expListView.setOnGroupExpandListener(new OnGroupExpandListener() {
#Override
public void onGroupExpand(int groupPosition) {
Toast.makeText(getApplicationContext(),
listDataHeader.get(groupPosition) + " Expanded",
Toast.LENGTH_SHORT).show();
}
});
// Listview Group collasped listener
expListView.setOnGroupCollapseListener(new OnGroupCollapseListener() {
#Override
public void onGroupCollapse(int groupPosition) {
Toast.makeText(getApplicationContext(),
listDataHeader.get(groupPosition) + " Collapsed",
Toast.LENGTH_SHORT).show();
}
});
// Listview on child click listener
expListView.setOnChildClickListener(new OnChildClickListener() {
#Override
public boolean onChildClick(ExpandableListView parent, View v,
int groupPosition, int childPosition, long id) {
// TODO Auto-generated method stub
Toast.makeText(
getApplicationContext(),
listDataHeader.get(groupPosition)
+ " : "
+ listDataChild.get(
listDataHeader.get(groupPosition)).get(
childPosition), Toast.LENGTH_SHORT)
.show();
return false;
}
});
}
/*
* Preparing the list data
*/
private void prepareListData() {
listDataHeader = new ArrayList<String>();
listDataChild = new HashMap<String, List<String>>();
// Adding child data
listDataHeader.add("Top 250"); // subTotal
// Adding child data
List<String> top250 = new ArrayList<String>();
top250.add("The Shawshank"); //price
listDataChild.put(listDataHeader.get(0), top250); // Header, Child data
DisplayMetrics metrics = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(metrics);
int width = metrics.widthPixels;
mExpandableList = (ExpandableListView)findViewById(R.id.lvExp);
mExpandableList.setIndicatorBounds(width - GetPixelFromDips(50), width - GetPixelFromDips(10)); }
public int GetPixelFromDips(float pixels) {
// Get the screen's density scale
final float scale = getResources().getDisplayMetrics().density;
// Convert the dps to pixels, based on density scale
return (int) (pixels * scale + 0.5f);
}
I was able to overcome this by doing.
String price;
String subTotal ;
subTotal = getIntent().getStringExtra("subTotal");
price = getIntent().getStringExtra("price");
listDataHeadersubTotal= new ArrayList<String>();
listDataHeaderPrice= new ArrayList<String>();
listDataHeadersubTotal.add(subTotal);
listDataHeaderPrice.add(price);
List<String> price= new ArrayList<String>();
price.add("The Shawshank");
List<String> subTotal= new ArrayList<String>();
subTotal.add("The Shawshank");
listDataChild.put(listDataHeadersubTotal.get(0), subTotal);
listDataChild.put(listDataHeaderPrice.get(0), price);
I have an expandle listview witha few children. If i click a child i want it to open it own activity. Right now i got it to work to go to 1 activity only. So when for example when i click on Mambo beach i want it to open an activity with the information of Mambo beach. And when i click on Avis car Rental it should open that acitivity
below my example:
public class TodoFragment extends Fragment {
public TodoFragment(){}
ExpandableListAdapter listAdapter;
ExpandableListView expListView;
List<String> listDataHeader;
HashMap<String, List<String>> listDataChild;
#Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState){
return inflater.inflate(R.layout.fragment_todo,container, false);
}
#Override
public void onStart() {
super.onStart();
// get the listview
expListView = (ExpandableListView) getView().findViewById(R.id.lvExp);
// preparing list data
prepareListData();
listAdapter = new ExpandableListAdapter(getActivity(), listDataHeader, listDataChild);
// setting list adapter
expListView.setAdapter(listAdapter);
// Listview Group click listener
expListView.setOnGroupClickListener(new OnGroupClickListener() {
#Override
public boolean onGroupClick(ExpandableListView parent, View v,
int groupPosition, long id) {
// Toast.makeText(getApplicationContext(),
// "Group Clicked " + listDataHeader.get(groupPosition),
// Toast.LENGTH_LONG).show();
return false;
}
});
// Listview on child click listener
expListView.setOnChildClickListener(new OnChildClickListener() {
#Override
public boolean onChildClick(ExpandableListView parent, View v,
int groupPosition, int childPosition, long id) {
//You have to create next activity say NextActivity.java
Intent intent = new Intent(getActivity(), MainActivity.class);
startActivity(intent);
return false;
}
});
}
/*
* Preparing the list data
*/
private void prepareListData() {
listDataHeader = new ArrayList<String>();
listDataChild = new HashMap<String, List<String>>();
// Adding group data
listDataHeader.add("Culture");
listDataHeader.add("Beaches");
listDataHeader.add("Car Rental");
listDataHeader.add("Dinner");
// Adding child data
List<String> culture= new ArrayList<String>();
culture.add("Grotten van Hato");
culture.add("Ostrich Farm");
culture.add("Shete Boka national Park");
culture.add("Landhuis Knip");
culture.add("Christoffelpark");
culture.add("Navy Museum");
culture.add("Post Museum");
List<String> beaches = new ArrayList<String>();
beaches.add("Mambo Beach");
beaches.add("Knip");
beaches.add("Playa Kalki");
beaches.add("Westpunt");
beaches.add("Boca Santa Cruz");
beaches.add("Cas Abao");
beaches.add("Playa PortoMari");
beaches.add("Kontiki Beach");
beaches.add("Jan Thiel Beach");
List<String> car = new ArrayList<String>();
car.add("budget rental");
car.add("Avis Rental");
car.add("Alamo Car Rental");
car.add("Noordstar Rental");
car.add("Europa Rental");
List<String> dinner = new ArrayList<String>();
dinner.add("Truk di Pan");
dinner.add("Burger King");
dinner.add("Punda Food");
// Header, Child data
listDataChild.put(listDataHeader.get(0), culture);
listDataChild.put(listDataHeader.get(1), beaches);
listDataChild.put(listDataHeader.get(2), car);
listDataChild.put(listDataHeader.get(3), dinner);
}
}
You could implement this by simply creating, and launching, a different Intent based on the value of childPosition. For example:
switch (childPosition)
{
case 0:
Intent intentChild0 = new Intent(yourMainActivity.this, ActivityForChild0.class);
startActivity(intentChild0);
break;
case 1:
Intent intentChild1 = new Intent(yourMainActivity.this, ActivityForChild1.class);
startActivity(intentChild1);
break;
//Etc...
default:
break;
}
Adding this to your OnChildClickListener will cause a different Activity to be launched depending on what child was clicked.
There are 2 solutions: one is switch the child position and redirect the activity.But this solution has a problem, because you will have many activities and your project will not be ordered.
The other solution is implement one activity and many fragments depends of how many child you have. In your activity you only redirect the fragment depends of the child id.
I want to implement tab in my application. Tab works well. Now implementing expandable list view in one of the tab... That means activity extends Fragment and not FragmentActivity... But I face a problem in expendable list view... How can I overcome this... Here is my code...
public class Setting extends Fragment{
ExplistAdapter listAdapter;
ExpandableListView expListView;
List<String> listDataHeader;
HashMap<String, List<String>> listDataChild;
#Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.setting, container, false);
expListView = (ExpandableListView)rootView. findViewById(R.id.lvExp);
// preparing list data
prepareListData();
listAdapter = new ExplistAdapter(this, listDataHeader, listDataChild);
// setting list adapter
expListView.setAdapter(listAdapter);
return rootView;
}
private void prepareListData() {
listDataHeader = new ArrayList<String>();
listDataChild = new HashMap<String, List<String>>();
// Adding child data
listDataHeader.add("Top 250");
listDataHeader.add("Now Showing");
listDataHeader.add("Coming Soon..");
// Adding child data
List<String> top250 = new ArrayList<String>();
top250.add("Remaining Battery");
top250.add("Set Alarm Distance");
top250.add("Pick Alarm Tone");
top250.add("Set Vibrate");
List<String> nowShowing = new ArrayList<String>();
nowShowing.add("Remaining Battery");
nowShowing.add("Set Alarm Distance");
nowShowing.add("Pick Alarm Tone");
nowShowing.add("Set Vibrate");
List<String> comingSoon = new ArrayList<String>();
comingSoon.add("2 Guns");
comingSoon.add("The Smurfs 2");
comingSoon.add("The Spectacular Now");
comingSoon.add("The Canyons");
comingSoon.add("Europa Report");
listDataChild.put(listDataHeader.get(0), top250); // Header, Child data
listDataChild.put(listDataHeader.get(1), nowShowing);
listDataChild.put(listDataHeader.get(2), comingSoon);
}
}
error show on
listAdapter = new ExplistAdapter(this, listDataHeader, listDataChild);
Use getActivity() instead of this in your constructor. i suggest you to remove filling data into method onActivityCreated(). As getActivity() is ensured to return the activity creating the fragment only after getting this method called. And this is according to Android Developers docs link: http://developer.android.com/guide/components/fragments.html
So, remove your filling of data into onActivityCreated() and use getActivity() as the context passed to your adapter
I'm facing trouble with my application, what i want to do is when i click the child of exp list it will play song.
it's clear when start play first song but after stop and I play it again an error display in my logcat.
I don't know how to solve this problem.
please help...
Here's my code:
public class BacktrackActivity extends Activity {
MediaPlayer mp;
ExpandableListAdapter listAdapter;
ExpandableListView expListView;
List<String> listDataHeader;
HashMap<String, List<String>> listDataChild;
Context context;
public ImageButton stop;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.backtrack);
// final int[] blues = {R.raw.satch_boogie, R.raw.satch_boogie};
mp = MediaPlayer.create(this, R.raw.satch_boogie);
// get the listview
expListView = (ExpandableListView) findViewById(R.id.genre_list);
// preparing list data
prepareListData();
listAdapter = new ExpandableListAdapter(this,listDataHeader,listDataChild);
// setting list adapter
expListView.setAdapter(listAdapter);
stop = (ImageButton) findViewById(R.id.imageButton1);
stop.setOnClickListener(new OnClickListener() {
#Override
public void onClick(View view) {
mp.stop();
mp.reset();
}
});
expListView.setOnGroupClickListener(new OnGroupClickListener() {
public boolean onGroupClick(ExpandableListView parent, View v, int groupPosition,
long id) {
// TODO Auto-generated method stub
return false;
}
});
expListView.setOnGroupExpandListener(new OnGroupExpandListener() {
#Override
public void onGroupExpand(int groupPosition) {
Toast.makeText(getApplicationContext(), "Choose your " +
listDataHeader.get(groupPosition) + " Backtrack",
Toast.LENGTH_SHORT).show();
}
});
// Listview on child click listener
expListView.setOnChildClickListener(new OnChildClickListener() {
public boolean onChildClick(ExpandableListView parent, View v,
int groupPosition, int childPosition, long id) {
mp.start();
return false;
}
});
}
/*
* Preparing the list data
*/
private void prepareListData() {
listDataHeader = new ArrayList<String>();
listDataChild = new HashMap<String, List<String>>();
// Adding child data
listDataHeader.add("Blues");
listDataHeader.add("Jazz");
listDataHeader.add("Rock");
listDataHeader.add("RnB");
// Adding child data
List<String> Blues = new ArrayList<String>();
Blues.add("The Shawshank Redemption");
Blues.add("The Godfather");
Blues.add("The Godfather: Part II");
Blues.add("Pulp Fiction");
Blues.add("The Good, the Bad and the Ugly");
Blues.add("The Dark Knight");
Blues.add("12 Angry Men");
List<String> Jazz = new ArrayList<String>();
Jazz.add("The Conjuring");
Jazz.add("Despicable Me 2");
Jazz.add("Turbo");
Jazz.add("Grown Ups 2");
Jazz.add("Red 2");
Jazz.add("The Wolverine");
List<String> Rock = new ArrayList<String>();
Rock.add("2 Guns");
Rock.add("The Smurfs 2");
Rock.add("The Spectacular Now");
Rock.add("The Canyons");
Rock.add("Europa Report");
List<String> RnB = new ArrayList<String>();
RnB.add("2 Guns");
RnB.add("The Smurfs 2");
RnB.add("The Spectacular Now");
RnB.add("The Canyons");
RnB.add("Europa Report");
listDataChild.put(listDataHeader.get(0), Blues); // Header, Child data
listDataChild.put(listDataHeader.get(1), Jazz);
listDataChild.put(listDataHeader.get(2), Rock);
listDataChild.put(listDataHeader.get(3), RnB);
}
}
here's my logcat error
12-04 08:52:54.317: W/Trace(1413): Unexpected value from nativeGetEnabledTags: 0
12-04 08:52:54.336: E/MediaPlayer(1413): start called in state 1
12-04 08:52:54.336: E/MediaPlayer(1413): error (-38, 0)
12-04 08:52:54.356: W/Trace(1413): Unexpected value from nativeGetEnabledTags: 0
12-04 08:52:54.356: W/Trace(1413): Unexpected value from nativeGetEnabledTags: 0
12-04 08:52:54.416: W/Trace(1413): Unexpected value from nativeGetEnabledTags: 0
12-04 08:52:54.416: W/Trace(1413): Unexpected value from nativeGetEnabledTags: 0
12-04 08:52:54.466: E/MediaPlayer(1413): Error (-38,0)
Usually this kind of error happens when you try to call start() before prepare() is finished.
Before calling mp.start(); you should make sure that you have already set the setDataSource() and prepare() is completed.
In your code by clicking stop, you have reset the media.So before calling mp.start() again you should at least setDataSource() again.
IMHO, it worked the first time because you have set the data source ( MediaPlayer.create(this, R.raw.satch_boogie); )inside the onCreate() method and there is enough time for it to prepared by the time you click the listView child.
Try setDataSource (MediaPlayer.create(this, R.raw.satch_boogie);) anytime you reset it.