I bulld a music player.but when i try to play a music from list view to playactivity app will crushed

i build a music player app in android studio.but when i click play music in main activity from listview to playactivity but apps will crushednd.this is my code for play song main activity to playerActivity

show some error message in logcat :

2021-11-24 01:18:32.711 12148-12148/? I/xample.shplaye: Late-enabling -Xcheck:jni
2021-11-24 01:18:32.711 12148-12148/? I/xample.shplaye: Late-enabling -Xcheck:jni
2021-11-24 01:18:32.711 12148-12148/? I/xample.shplaye: Late-enabling -Xcheck:jni
2021-11-24 01:18:33.632 12148-12148/com.example.shplayer I/Perf: Connecting to perf service.
2021-11-24 01:18:41.649 12148-12177/com.example.shplayer I/xample.shplaye: ProcessProfilingInfo new_methods=0 is saved saved_to_disk=0 resolve_classes_delay=8000
please help how can i solve it.

this is the code :
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> adapterView, View view, int position, long l) {
String songName = (String) listView.getItemAtPosition(position);
startActivity(new Intent(getApplicationContext(), PlayerActivity.class)
.putExtra("songs", mySongs)
.putExtra("songname", songName)
.putExtra("pos", position));

Source: Android Questions

LEAVE A COMMENT