我有这个代码不能正常工作
ImageButton save = (ImageButton) findViewById(R.id.save);
save.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String state = Environment.getExternalStorageState();
if (!Environment.MEDIA_MOUNTED.equals(state)) {
Toast.makeText(PDFGoster.this,"You cannot do that.",Toast.LENGTH_LONG).show();
}
File pdfDir = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOCUMENTS),
"MyList");
if (!pdfDir.exists()){
pdfDir.mkdir();
}
LayoutInflater inflater = (LayoutInflater) PDFGoster.this.getSystemService(LAYOUT_INFLATER_SERVICE);
RelativeLayout root = (RelativeLayout) inflater.inflate(R.layout.pdf, null);
root.setDrawingCacheEnabled(true);
Bitmap screen= getBitmapFromView(PDFGoster.this.getWindow().findViewById(R.id.tabla_cuerpo));
File pdfFile = new File(pdfDir, "MyList.pdf");
try {
Document document = new Document();
PdfWriter.getInstance(document, new FileOutputStream(pdfFile));
document.open();
ByteArrayOutputStream stream = new ByteArrayOutputStream();
screen.compress(Bitmap.CompressFormat.PNG, 100, stream);
byte[] byteArray = stream.toByteArray();
addImage(document,byteArray);
document.close();
}
catch (Exception e){
e.printStackTrace();
}
Intent intent = new Intent("android.intent.action.OPEN_DOCUMENT");
Uri uri = Uri.fromFile(new File(pdfDir, "MyList"));
intent.setDataAndType(uri, "application/pdf");
intent.setFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);
Toast.makeText(PDFGoster.this, "List successfully created", Toast.LENGTH_LONG).show();
startActivity(intent);
}
});
我收到错误
SELECT *
FROM (
TABLE_QUERY(YourDataset, 'LEFT(table_id, 4) = "abc_" AND LENGTH(table_id) = 14
AND CONCAT(SUBSTR(table_id,11,4),'-',SUBSTR(table_id,5,2), -",SUBSTR(table_id,8,2))
BETWEEN "2016-01-01" AND "2016-03-12"')
)