可以使用下面代码代替:

ContextCompat.getColor(getContext(), R.color.post_list_content_color)

需要引入:

compile 'com.android.support:support-v4:23.0.0'

android 获取颜色 getColor 方法 deprecated 过期的更多相关文章

  1. Android获取系统时间方法的总结

    Android获取系统时间方法的方法有很多种,常用的有Calendar.Date.currentTimeMills等方法. (1)Calendar Calendar获取系统时间首先要用Calendar ...

  2. android获取时间差的方法

    本文实例讲述了android获取时间差的方法.分享给大家供大家参考.具体分析如下: 有些时候我们需要获取当前时间和某个时间之间的时间差,这时如何获取呢? 1. 引用如下命名空间: import jav ...

  3. android 获取路径目录方法以及判断目录是否存在,创建目录

    Environment 常用方法: * 方法:getDataDirectory()解释:返回 File ,获取 Android 数据目录.* 方法:getDownloadCacheDirectory( ...

  4. Android获取前台进程的方法

    概述 项目中很多场景交互非常依赖于客户端的前后景状态以及其他一些辅助信息上传,譬如当前新闻在前台(看到的是新闻界面)播放时,语音开启音乐应用,此时我们希望能看到音乐界面,并且音乐在播;而在导航应用在前 ...

  5. Android 获取keystore SHA1方法

    (第一种方式)通过Android Studio编译器获取SHA1 第一步.打开Android Studio的Terminal工具 第二步.输入命令:keytool -v -list -keystore ...

  6. android获取路径目录方法

    Environment常用方法: getExternalStrongeDirectory() 返回File,获取外部存储目录即SDCard getDownloadCacheDirectory() 返回 ...

  7. android获取mac地址方法

    http://www.cnblogs.com/xioapingguo/p/4037513.html 网上找的,记录一下 public static String getMacAdress(){ Wif ...

  8. android 获取字符串的方法

    字符串数组可以在value文件夹中声明: 书写的内容是: 两者的读取方式略有不同: 如果是读取数字的话,  使用: context.getResources().getStringArray( R.a ...

  9. Android获取系统时间的多种方法

    Android中获取系统时间有多种方法,可分为Java中Calendar类获取,java.util.date类实现,还有android中Time实现. 现总结如下: 方法一: ? 1 2 3 4 5 ...

随机推荐

  1. Centos 7 firewall的防火墙的规则

    这是官方文档: http://www.firewalld.org/documentation/man-pages/firewall-cmd.html 想使用iptables的规则,firewall也可 ...

  2. C# WinForm MessageBox.Show显示在窗体中间

    一.新建MessageBoxEx类,并添加以下代码. using System; using System.Windows.Forms; using System.Text; using System ...

  3. the simmon effect(in psychology) :build the function of subject_information(modify the experiment programme),before we begin the experiment

    #the real experiment for simon effect #load the library which is our need import pygame import sys i ...

  4. vue报错There are multiple modules with names that only differ in casing. This can lead to unexpected behavior when compiling on a filesystem with other case-semantic. Use equal casing. Compare these mod

    今天在开发一个新项目时,当安装完依赖包启动项目后报了一个这个错 There are multiple modules with names that only differ in casing.Thi ...

  5. ES6实现图片切换特效

    效果图 demo.html <!DOCTYPE html> <html lang="en"> <head> <meta charset=& ...

  6. jQuery---prop方法和表格全选案例

    prop方法和表格全选案例 对于布尔类型的属性,不用attr方法,应该用prop方法 prop用法跟attr方法一样 <input type="button" value=& ...

  7. linux基础之CnetOS安装

    CentOS启动流程 POST-->boot sequence(bios)--> bootloader(mbr)-->kernel(ramdisk)-->rootfs(ro)- ...

  8. Codeforces Round #350 (Div. 2)(670C)

    今天对着算法进阶指南,学了一下离散化.大概对桶排这样的算法优化比较好吧. 离散化:就是把无穷大的集合中若干个元素映射为有限集合以便于统计的方法.例如在很多时候,问题范围定义为整数集合Z,但涉及的元素只 ...

  9. burpsuite各个板块儿详细讲解

    burpsuite实战指南,想要的都在这里:https://t0data.gitbooks.io/burpsuite/content/

  10. 优化公式排版和Beamer相关知识

    做优化的同学可能会碰到排列形如 max    ******* s.t.   ***** = *        ***** > ***        ...    的格式 既要要求 max 和 s ...