摘要:
向上取整用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 阅读全文
摘要:
public int getCount() { SQLiteDatabase db = dbOpenHelper.getReadableDatabase(); Cursor cursor = db.rawQuery("select count(id) from table",null); cursor.moveToFirst(); Long count = cursor.getI... 阅读全文
摘要:
WindowManager m = getActivity().getWindowManager();DisplayMetrics metric = new DisplayMetrics();m.getDefaultDisplay().getMetrics(metric);int width = m... 阅读全文