Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to remain the listView index selected and highlighted?
    primarykey
    data
    text
    <p>In My app i have implement the <code>ListView</code>. Now i want it to set as like that: If i select on perticular index it should be remain as selected. ans appear as selected on <code>ListView</code>. If i select another index then now that new index should be remain as selected.</p> <p><strong>Edited</strong></p> <p>Means I want to set as the selected index should remain as highlighted as selected till I select another. but not like multiple selected.</p> <p>So how to do it ?</p> <p>Please help me for that. I have implemented the <code>ListView</code> as like below code:</p> <pre><code>phonemesListView = (ListView) findViewById(R.id.phonemsListView); private String[] Phonemes_List = new String[]{"P","B","T","D","K","G","N","M","ING","TH v","TH vl","F","V","S","Z","SH","CH","J","L","R rf","R b"}; phonemesListView.setAdapter(new ArrayAdapter&lt;String&gt;(this,R.layout.phonemes_list_row, R.id.phonemes,Phonemes_List)); @Override public void onItemClick(AdapterView&lt;?&gt; parent, View view,final int Position,long id) { phonemsText.setText(Phonemes_List[Position]); Toast.makeText(getApplicationContext(), "Phonems: "+Phonemes_List[Position], Toast.LENGTH_SHORT).show(); // view.setBackgroundColor(Color.RED); // phonemesListView.setBackgroundColor(Color.BLUE); jumposition = Position; int temp = 0; if(jumpCount == -1){ view.setBackgroundColor(Color.BLUE); jumpCount = jumposition; JumpView = view; temp = 1; } if(temp == 0) { if(jumpCount == jumposition) { view.setBackgroundColor(Color.BLUE); JumpView = view; } else{ JumpView.setBackgroundColor(Color.TRANSPARENT); view.setBackgroundColor(Color.BLUE); jumpCount = jumposition; JumpView = view; } } } </code></pre> <p>Thanks.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload