常用函数

1、jackson 泛型

ObjectMapper objectMapper = null;
String json = “{\"list\":[{\"picUrl\":\"aa\",\"picDescr\":\"uu\"},{\"picUrl\":\"aa\",\"picDescr\":\"uu\"},{\"picUrl\":\"aa\",\"picDescr\":\"uu\"}]}”;
Map<String, Scenery[]> map = null;
objectMapper = JsonFactory.getInstance().getObjectMapper();

map  = objectMapper.readValue(json,new TypeReference<Map<String, Scenery[]>>(){});

 

2、jackson 自定义对象

ObjectMapper objectMapper = null;
Picture picture = null;
String json = “{\"pic\":\"aa\",\"picurl\":\"aaa\"}”;
objectMapper = JsonFactory.getInstance().getObjectMapper();

picture = objectMapper.readValue(json, Picturet.class);
//类型还可以是: Map.class  Picture[].class

 

3、android 隐藏标题栏

requestWindowFeature(Window.FEATURE_NO_TITLE);

 

 

 

 

 

你可能感兴趣的:(常用函数)