我正在尝试使用AlarmManager执行sqlite查询,但出现此错误:
无法解析方法openOrCreateDatabase()
我该怎么办?这是我的代码。
public class Alarma extends BroadcastReceiver {
private SQLiteDatabase db;
@Override
public void onReceive(Context context, Intent intent) {
String idOrder = intent.getStringExtra("idOrder");
db=openOrCreateDatabase("Clients", Context.MODE_PRIVATE, null);
ContentValues cv = new ContentValues();
cv.put("estado","Delivered");
cv.put("fechaEntrega",format2.format(new Date()));
db.update("orders", cv, "idOrder= ?", new String[]{idPedido});
db.close();
}
}