Garmaine Staff asked 3 months ago

I have a custom array adapter and I have a media player inside its getView() method and I want to make another method which other activities would be able to call and I want that method to stop that media player but I can neither make it public inside the getVeiw() nor get it out of there as I have to get the track ID from getView() method so is there a way I can access it from outside of getView without getting it out of there? Another problem is that I can't even access that methed from other activites and I don't know why?

public void stopMediaPlayer(boolean hasStopped){
    if(hasStopped){
        mediaPlayer.stop();
        mediaPlayer.release();
    } }