Java 生成字符串的Hash值: /** * A hashing method that changes a string (like a URL) into a hash suitable for using as a * disk filename. */ public static String hashKeyForDisk(String key) { String cacheKey; try { final MessageDigest mDigest = MessageDigest.g
首先说如何获取已经在style里面定义好的attr的值,以colorPrimary为例: TypedValue value = new TypedValue(); mContext.getTheme().resolveAttribute(R.attr.colorPrimary,value,true); value.data里面存储着的就是获取到的colorPrimary的值了. 其二,说一说如何获取自定义属性的值,这个在网上都传烂了,随便找段代码来贴上吧: public MyView(Conte