How to change the color and strike out the clicked listview item?

You'll need to create your custom background drawable for list item this links helps: developer.android.com/guide/topics/resou....

You'll need to create your custom background drawable for list item. This links helps: developer.android.com/guide/topics/resou....

Well you could add a OnItemClickListener to the list view. And when a item is selected. Set the background of that item and use the following code on the textview to strike it out textView.

SetPaintFlags(textView.getPaintFlags() | Paint. STRIKE_THRU_TEXT_FLAG).

Already I tried this code. If we click 3rd list item, the 1st list item alone is striked off. So I couldn't put it in my code... – PattabiRaman Sep 27 at 3:58 put the code up.

Lets see whats going wrong. – blessenm Sep 27 at 4:00 I'm now getting Null Pointer exception. Even I have declared textview globally, and provided the code within try catch, I get NullPointerException.

– PattabiRaman Sep 27 at 4:09 I cannot do much without seeing your code. – blessenm Sep 27 at 4:36.

You need to build the custom adapter for the List. Also in Custom adapter will need to override the function @Override public View getView(int position, View convertView, ViewGroup parent) { View view = super. GetView(position, convertView, parent); view.

SetBackgroundColor(Color. ParseColor("#ffffff")); return view; } This way you can do Text Striking out cell color change on selection and when it comes back after some operation. Please either put your code snippet of you list and adapter will help you better than.Vib.

I am using listview in my program that extends activity. I need to change the color of the clicked list item and strike out the clicked list item. How to do it?

Any help is really appreciated and thanks in advance...

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions