Listview : How to remain highlighted/selected after press back button?

davejohns

New Member
How to keep selected item in listview remain higlighted when we pressed back button? It is possible? I've went through this link but no replies. I managed to set background, image, and text in order them to change when user press the list.One of my xml:<selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_pressed="true" android:drawable="@color/light_grey" /><item android:state_selected="true" android:drawable="@color/light_grey"/><item android:state_activated="true" android:drawable="@color/light_grey"/><item android:state_focused="false" android:drawable="@color/white" /> notifiacation_row.xml<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"android:layout_width="match_parent"android:layout_height="match_parent"android:background="#FFFFFF"android:eek:rientation="vertical" ><LinearLayout android:layout_width="match_parent" android:layout_height="50dp" android:background="@drawable/activated_bg" > <ImageView android:id="@+id/imageView1" android:layout_width="30dp" android:layout_height="30dp" android:layout_gravity="center" android:layout_marginLeft="5dp" android:padding="4dp" android:src="http://stackoverflow.com/questions/15893171/@drawable/checkbox" /> <LinearLayout android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_weight="0.73" android:eek:rientation="vertical" > <TextView android:id="@+id/id_row" android:layout_width="match_parent" android:layout_height="wrap_content" android:visibility="gone" /> <TextView android:id="@+id/title_row" android:layout_width="match_parent" android:layout_height="25dp" android:layout_marginTop="5dp" android:layout_marginLeft="5dp" android:padding="2dp" android:text="Title" android:textColor="#000000" android:textSize="16sp" android:textStyle="bold" /> <TextView android:id="@+id/content_row" android:layout_width="match_parent" android:layout_height="wrap_content" android:visibility="gone" /> <TextView android:id="@+id/sendtime_row" android:layout_width="match_parent" android:layout_height="25dp" android:layout_marginLeft="5dp" android:maxLength="100" android:paddingBottom="2dp" android:paddingLeft="3dp" android:paddingRight="3dp" android:text="Date" android:textColor="#808080" android:textSize="15sp" /> </LinearLayout></LinearLayout>
 
Top