摘要: private AssetFileDescriptor getFileForWord(String word) { 第一个参数是你的资源文件的名字,不带后缀的,,第二个参数是你资源文件所在的目录,比如layout,drawable或者是values,,,第三个是你的包名,,,,, int soun... 阅读全文
posted @ 2014-09-17 17:43 mxyhws 阅读(3535) 评论(0) 推荐(0)
摘要: public static boolean isServiceRunning(Context mContext, String className) { boolean isRunning = false; ActivityManager activityManager = (ActivityM... 阅读全文
posted @ 2014-09-17 14:03 mxyhws 阅读(143) 评论(0) 推荐(0)
摘要: wait 和notify 在 synchronized 包含的范围中 必须与synchronized 使用同一个对象可以在一个锁中设定 多个 condition 来执行等待的方法,这样的好处就是能实现多个方法之间的等待执行。例如下面例子 的两个conditionclass BoundedBuffer... 阅读全文
posted @ 2014-09-05 08:49 mxyhws 阅读(176) 评论(0) 推荐(0)
摘要: public class CacheDemo { private Map cache = new HashMap(); public static void main(String[] args) { // TODO Auto-generated method stub } private Read... 阅读全文
posted @ 2014-09-05 08:48 mxyhws 阅读(136) 评论(0) 推荐(0)
摘要: public class LockTest { /** * @param args */ public static void main(String[] args) { new LockTest().init(); } private void init(){ final Outputer out... 阅读全文
posted @ 2014-09-05 08:47 mxyhws 阅读(1035) 评论(0) 推荐(0)
摘要: 创建固定大小的线程池 ExecutorService threadPool = Executors.newFixedThreadPool(3);创建缓存线程池 ExecutorService threadPool = Executors.newCachedThreadPool(3);创建单一线程池 ... 阅读全文
posted @ 2014-09-05 08:45 mxyhws 阅读(211) 评论(0) 推荐(0)
摘要: //读取内容public void read() throws Exception{SAXReader reader = new SAXReader();Document document = reader.read("src/book.xml");Element root = document.g... 阅读全文
posted @ 2014-08-14 13:45 mxyhws 阅读(122) 评论(0) 推荐(0)
摘要: js 中的标签java中的代码//公司的实体类private PublicBranchcompany company;//产品id的数组private List products;//操作接口private IUserDao iUserDao;public String execute(){try ... 阅读全文
posted @ 2014-07-14 10:09 mxyhws 阅读(519) 评论(0) 推荐(0)
摘要: //输入产品的类型的idprivate int productId;//输入上级代理人的登陆账号private String loginName;//输入所属的公司的idprivate int branchtId;//输入 购买黄金数量private int quantity;//输入输出 银行账号... 阅读全文
posted @ 2014-07-03 14:56 mxyhws 阅读(176) 评论(0) 推荐(0)
摘要: //界面按钮的显示隐藏 界面input的锁定 function change(){ document.getElementById('first1').style.display="inline"; document.getElementById('first2').style.display="i... 阅读全文
posted @ 2014-07-03 13:54 mxyhws 阅读(376) 评论(0) 推荐(0)