title: OnItemClickListener Play Audio In Another Activity
body: <p>Hello i am trying to learn android studio java programming , i am making simple audio player one list view and one play button , so i need help to audio play in another activity , how to set onitemclicklistener  to play audio in another activity please help me    </p>
  
  <pre><code>public void doStuff() {
  
      listView = (ListView) findViewById(R.id.listview);
      arrayList = new ArrayList&lt;&gt;();
      getVideo();
      adapter= new ArrayAdapter&lt;String&gt;(this, 
      android.R.layout.simple_list_item_1, arrayList);
      listView.setAdapter(adapter);
  
   }
  </code></pre>
  
  <p>//here what is code to write here to play audio in another activity just simple no title show with just play button</p>
  
  <pre><code>listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
  
          @Override
          public void onItemClick(AdapterView adapterView, View view, int i, 
          long l) {
          }
  
      });
  }
  </code></pre>
  
  <p>this is my second activity ,,i want to add just one button play only,, i am new so please understand this</p>
  
  <pre><code>   public class Main2Activity extends AppCompatActivity {
     MediaPlayer mp;
     Button bt;
     @Override
     protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main2);
      bt = (Button)findViewById(R.id.play);
  
  
      Intent intent=getIntent();
      int position  = (int) intent.getLongExtra("position", 0);
      if(position!=0){
          //get your song from the position variable 'position' received here
          //and you can start playing your song
          bt.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View view) {
                  if (mp.isPlaying()){
                      mp.pause();
                  }else {
                      mp.start();
                  }
  </code></pre>