遗忘海岸

江湖程序员 -Feiph(LM战士)

导航

Java一行代码

1.整数格式化成0X 的形式字符串

String hour=String.format("%02d", txtWaringTime.getCurrentHour());
String minute=String.format("%02d", txtWaringTime.getCurrentMinute());

2.导出sqlLite数据库

DBHelper dbHelper = new DBHelper(getApplicationContext());
SQLiteDatabase db = dbHelper.getWritableDatabase();
String dbPathString=db.getPath();
FileUtil.copyfile(new File(db.getPath()), new File(
Environment.getExternalStorageDirectory()+ "/MNotify.db"), true);

posted on 2019-10-25 08:42  遗忘海岸  阅读(207)  评论(0编辑  收藏  举报