Google 클라우드 프린트를 Android 프로젝트와 함께 사용하여 PDF 파일을 인쇄하고 있습니다. 프로젝트의 assets 폴더에 파일을 저장할 때 인쇄 할 때 "Document Missing"이라고 말합니다.Android 클라우드 프린트 사용
여기에 내 코드 어떤 도움에 감사드립니다
public void stevePrint(View view) {
Intent printIntent = new Intent(this, PrintDialogActivity.class);
//Cant find file, why?
File file = new File("/assets/steve.pdf");
printIntent.setDataAndType(Uri.fromFile(file), "document/pdf");
printIntent.putExtra("title", "Steve");
startActivity(printIntent);
Context context = getApplicationContext();
CharSequence text = "Sending to Google Cloud Print";
int duration = Toast.LENGTH_LONG;
Toast toast = Toast.makeText(context, text, duration);
toast.show();
}
입니다!
file.exists()가 true를 반환합니까? – flumpb