title: How to make listview selected one item element?
body: <p>I am working on the custom Listview using BaseAdapter. I am facing one small issue after tap on listview item that particular row gets highlighted but after that if i'll tap one another list item it's highlighted but still the older one it remains same it's not going to it's previous state.</p>
  
  <p>I want to see one item should select at one time.</p>
  
  <p><a href="https://i.stack.imgur.com/6yW7y.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6yW7y.png" alt="enter image description here"></a>  </p>
  
  <p>MainActivity.java</p>
  
  <pre><code>if (musicRealmResults.get(currentIndex).isSelected() == false) {
      musicRealmResults.get(currentIndex).setIsSelected(true);
  
      playSong(currentIndex, true);
  
      adapter.notifyDataSetChanged();
  } else {
      musicRealmResults.get(currentIndex).setIsSelected(false);
      adapter.notifyDataSetChanged();
  }
  </code></pre>
  
  <p>MusicAdapter.java</p>
  
  <pre><code>if (musicRealmResults.get(position).isSelected()) {
  
      Typeface tf = Typeface.createFromAsset(mContext.getAssets(), "fonts/fonts_bold.otf");
      holder1.albumsTextView.setTypeface(tf);
  
      holder1.equalizerView.setVisibility(View.VISIBLE);
      holder1.albumsImageView.setVisibility(View.INVISIBLE);
      holder1.equalizerView.animateBars();
  } else {
      Typeface tf = Typeface.createFromAsset(mContext.getAssets(), "fonts/fonts_regular.otf");
      holder1.albumsTextView.setTypeface(tf);
  
      holder1.equalizerView.setVisibility(View.GONE);
      holder1.albumsImageView.setVisibility(View.VISIBLE);
      holder1.equalizerView.stopBars();
  }
  </code></pre>
  
  <p>Please kindly go through my post and suggest me how to do select and deselect in a listview row.</p>