getColor方法在6.0中已经过时
可以参考以下方法:
ContextCompat.getColor(context, R.color.my_color)
具体使用是:
详细内容请看文章:http://blog.csdn.net/explorerqp/article/details/48546093
可以参考以下方法:
ContextCompat.getColor(context, R.color.my_color)
具体使用是:
private TextView tv_buy;
tv_buy = (TextView) findViewById(R.id.tv_buy);
//tv_buy.setTextColor(this.getResources().getColor(R.color.green));//已经过时
tv_buy.setTextColor(ContextCompat.getColor(this,R.color.green));//替代已过时getColor
详细内容请看文章:http://blog.csdn.net/explorerqp/article/details/48546093