Dear experts, I have a list view with two items in each row(one below another). I have changed the background white and its focus-selection color but my requirement is as follows
There are two items(both textviews) in each list item(one below other) Upper textview's color is orange and lower textview's color is blue ,but both textview's background colour is white. Now I want to reverse the color with background color on focus It means selected list item's upper textcolor will be of white color and its background color will be of orange. and lower textview's color will be of white and its background will be of blue whenever the list item's get focus. The list view has a separate xml file which is as follows <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/ android" android:layout_height="?android:attr/listPreferredItemHeight" android:layout_width="fill_parent" android:orientation="vertical" android:background="@android:color/white"> <TextView android:id="@android:id/text1" android:layout_width="wrap_content" android:gravity="center_vertical" android:layout_height="wrap_content" android:textSize="16dip" android:textColor="#ffFFA500"> </TextView> <TextView android:id="@android:id/text2" android:layout_width="wrap_content" android:gravity="center_vertical" android:layout_height="wrap_content" android:textSize="20dip" android:textColor="#ff6698FF"> </TextView> </LinearLayout> and my class implemented with ListActivity main code is as follows setListAdapter(new ArrayAdapter<MatterClient>(this, R.layout.matterlistlayout_listitem, matterclientlist) { @Override public View getView(int position, View convertView, ViewGroup parent) { View row; if (null == convertView) { row = mInflater.inflate(R.layout.matterlistlayout_listitem, null); } else { row = convertView; } MatterClient client = (MatterClient)matterclientlist.get(position); TextView tv = (TextView) row.findViewById(android.R.id.text1); tv.setText(client.getClientname()); TextView tv1 = (TextView) row.findViewById(android.R.id.text2); tv1.setText(client.getMattername()); client = null; return row; } }); and MatterClient code is as follows class MatterClient { String matterid; String clientid; String mattername; String clientname; String flag; /* Its getter and setter methods */ } -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en