hi instead of int values can use Color.xxx(default color values) or if you want your own designed colors make a colors.xml class under res/values and use setBackgroundResource() to set a particular color of your choice.
On Oct 20, 8:45 am, "pramod.deore" <[email protected]> wrote: > Thanks Grace for reply, > I had add in code as > getListView().setBackgroundColor(123123); > But still color is not changed. I had also tried different int values > but still color is not changed. > > On Oct 19, 3:55 pm, grace <[email protected]> wrote: > > > try using on of these methods on the listview setBackgrooooungdColor() > > or setBackgroungDrawable() or setBackgroundResource(). > > to set the color to your listview > > > On Oct 19, 2:57 pm, "pramod.deore" <[email protected]> wrote: > > > > Hi , I have developing list as > > > public class AddSwitch extends ListActivity > > > { > > > > public void onCreate(Bundle savedInstanceState) > > > { > > > System.out.println ("First stmt in onCreate of AddSwitch"); > > > > super.onCreate(savedInstanceState); > > > > String[] switchName = > > > getResources().getStringArray(R.array.Switch_array); > > > setListAdapter(new > > > ArrayAdapter<String>(this,android.R.layout.simple_list_item_1, > > > switchName)); > > > getListView().setTextFilterEnabled(true); > > > } > > > > protected void onListItemClick(ListView l, View v, int position, > > > long > > > id) > > > { > > > } > > > > public void onItemSelected(AdapterView parent,View v,int > > > position,long id) > > > { > > > > } > > > > } > > > > Now I want to change the color of list to other color. How to do > > > that? Because here I had not used any .xml file so how to write code > > > to change the color of list? > > > > Thanks > > -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

