The text color is wrong because you're not correctly handling recycled views.
The shortest and simplest solution is to remove this check:
if (v == null)
and inflate a new view every time. This is less efficient, but will make your code easier to work with.
The solution if you opt to continue using recycled views is to explicitly set the text color and clickability of the button every time:
if (p.getJSONArray().equals("YES")) {
ButtonListViewItem.setClickable(false);
ButtonListViewItem.setTextColor(0xff3399FF);
} else {
ButtonListViewItem.setClickable(true);
ButtonListViewItem.setTextColor(0xff000000);
}
The reason you need to do that is because recycled views are handed over just as you left them, changed attributes and all. They will no longer match your XML layout. So when a view that was previously tied to a "YES" is recycled, the changes you made to the text color will still be in place: the text will be blue and the button won't be clickable.
Inflating a new view allows you start in a known state every time---you'll always have something that starts off matching your XML. The tradeoff is efficiency, inflating views is relatively expensive. If your apps needs to be more efficient you should look into the view holder pattern as well, as finding views is also an expense that can be avoided.