当我在查询中使用 json_extract 时出现错误
android.database.sqlite.SQLiteException:没有这样的函数:json_extract(代码1)
room 支持 json_extract 功能吗?
这是我的查询:
select sum(json_extract((select distinct replace(tfo.products, '\','')), '$[0].qty_case')) as QtyCase from tfo where strftime('%m', dateCreated) = strftime('%m', 'now', '0 months') and armstrong2CustomersId = 'OPDB00140428AU' and armstrong2TfoId = '9466c9d5-7d58-4d92-96e0-010662aa0055'
Run Code Online (Sandbox Code Playgroud) 当我触摸片段中的编辑文本时,我想使用AlertDialog来显示日历.在过去,当我使用Activity类时,它工作得很完美.但是当我使用Fragment时,它无法正常工作.
以下是在Fragment中触摸编辑文本时显示日历对话框的方法:
private void setDateTimeField() {
try {
et_date.setOnClickListener(this);
final Calendar newCalendar = Calendar.getInstance();
fromDatePickerDialog = new DatePickerDialog(this, new DatePickerDialog.OnDateSetListener() {
public void onDateSet(DatePicker view, int year, int monthOfYear, int dayOfMonth) {
Calendar newDate = Calendar.getInstance();
newDate.set(year, monthOfYear, dayOfMonth - 1);
if (newDate.getTime().getTime() > (newCalendar.getTime().getTime())) {
final AlertDialog builder = new AlertDialog.Builder(getActivity()).setTitle("Notification").setMessage("This is a date of future! We will get current date for this review!").show();
//this code below is coppied in https://xjaphx.wordpress.com/2011/07/13/auto-close-dialog-after-a-specific-time/
final Timer t = new Timer();
t.schedule(new TimerTask() …Run Code Online (Sandbox Code Playgroud)