Skip to content

Instantly share code, notes, and snippets.

@TangKe
TangKe / gist:6506295
Last active December 22, 2015 17:28
获取当前theme的某个属性引用的值
TypedArray typedArray = obtainStyledAttributes(null,new int[] { android.R.attr.listSelector },android.R.attr.listViewStyle, 0);
Drawable drawable = typedArray.getDrawable(0);
或者
TypedValue value = new TypedValue();
getResource().getTheme().resolveAttribute(android.R.attr.listSelector, value, true);
value.getDrawable();
@TangKe
TangKe / gist:6387090
Last active December 22, 2015 00:09
for Hao
package com.example.test;
import java.io.Closeable;
import java.io.IOException;
public abstract class Parser<Input, Reader, Result> {
public Result parse(Input input) throws IOException {
if (null == input) {
return null;
}