I use a simple adapter to display my code. Unfortunately, I need to change the top color of the textView.
This is a piece of code:
// Keys used in Hashmap String[] from = { "txt1", "txt2" }; // Ids of views in listview_layout int[] ids = { android.R.id.text1, android.R.id.text2 }; SimpleAdapter adapter = new SimpleAdapter(this, aList, android.R.layout.simple_list_item_2, from, ids); setListAdapter(adapter);
I tried to create my own simple_list_item_2, but for some reason it will not let me change the color of the textView in xml. Any ideas on how to do this?
My last thought:
findViewById(android.R.id.text1).setTextColor(#000) , but I don't know where to put it, and my hex code is not working.
java android xml simpleadapter
EGHDK
source share