zoukankan      html  css  js  c++  java
  • android 属性系统使用的小问题

     http://blog.csdn.net/njhao/archive/2010/10/11/5932635.aspx

    原理说明:http://www.williamhua.com/2010/03/05/android-property-system/

    注意点

    1. System.getProperty只能访问process自有的property
    2. 如需访问System Property,需要利用反射机制调用SystemProperty.get
    1. public static int getInt(String key, int def) {  
    2.         try  
    3.         {  
    4.             // this field is not available in Android SDK  
    5.             if(getIntMethod == null)  
    6.             {  
    7.                 getIntMethod = Class.forName("android.os.SystemProperties").getMethod("getInt", new Class[] {String.class, int.class});  
    8.             }  
    9.             return (Integer) getIntMethod.invoke(null, new Object[] {key, def});  
    10.         } catch(Exception e)  
    11.         {  
    12.             throw new RuntimeException("Platform error", e);  
    13.         }                     
    14. //      return def;  
    15.     } 
  • 相关阅读:
    JQuery实现数组移除指定元素
    美团酒旅面经
    搜狗一面
    360面经
    头条面经
    搜狐笔试题
    kolakoski序列
    函数的节流
    隐藏元素的几种方法
    移动端适配与响应式布局
  • 原文地址:https://www.cnblogs.com/leaven/p/1948145.html
Copyright © 2011-2022 走看看