Changing color of the row that has been selected by longclick in ListView Android
<p>I want to highlight the selected row on my <code>ListView</code> when it's long pressed. Now I'm able to do that when the row just clicked as in photo: </p>

<p><img src="https://i.stack.imgur.com/JC5PN.jpg" alt="selected row.jpg"></p>

<p>How can I do this with long click?
My <code>setOnItemLongClickListener</code> function so far:</p>

<pre><code>user_data.setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() {
      @Override
      public boolean onItemLongClick(AdapterView&lt;?&gt; adapterView, View view, int i, long l) {
           selected_note = adapterView.getItemAtPosition(i).toString();
           user_data.setItemChecked(i,true);
           return  true;
      }
});
</code></pre>