摘要: 向上取整用Math.ceil(double a) 向下取整用Math.floor(double a) 举例: double a=35; double b=20; double c = a/b; System.out.println("c >"+c); //1.75 System.out.printl 阅读全文
posted @ 2015-11-17 16:51 安谧世界 阅读(541) 评论(0) 推荐(0) 编辑
摘要: public int getCount() { SQLiteDatabase db = dbOpenHelper.getReadableDatabase(); Cursor cursor = db.rawQuery("select count(id) from table",null); cursor.moveToFirst(); Long count = cursor.getI... 阅读全文
posted @ 2015-11-17 16:50 安谧世界 阅读(11881) 评论(0) 推荐(0) 编辑
摘要: WindowManager m = getActivity().getWindowManager();DisplayMetrics metric = new DisplayMetrics();m.getDefaultDisplay().getMetrics(metric);int width = m... 阅读全文
posted @ 2015-11-17 10:35 安谧世界 阅读(156) 评论(0) 推荐(0) 编辑