brian4342
brian4342

Reputation: 1253

how to change the font color of an item in a gridview (android)

I have a gridview of letters for a wordsearch and I'm trying to get it so when you click on a letter it changes colour (which is working fine). But I also want to be able to change the font color back if the word is not correct.

public void onItemClick(AdapterView<?> parent, View v, int position, long id) 
            {            
                Toast.makeText(TodaysPuzzleClass.this, "" + position, Toast.LENGTH_SHORT).show();        
                ((TextView) v).setTextColor(Color.BLUE);
}

This is the code so when I click on an item it changes color.

Using the coordinates from my toast is it possble to change the items color that way?

looking aroung i need to use the postion if the item then changes its color, but how do i do that?

Upvotes: 2

Views: 2105

Answers (1)

Yugesh
Yugesh

Reputation: 4092

Try this one,

((TextView) v).setTextColor(Color.parseColor("#000000"));

Upvotes: 1

Related Questions