Any idea?
For example for this example code:
- Code: Select all
public class ExportNotebookToWordTask extends RoboAsyncTask<Void> {
private ProgressDialog exportProgress;
private Activity activity;
protected ExportNotebookToWordTask (Context context, Activity activity) {
super(context);
this.activity = activity;
exportProgress = new ProgressDialog(activity);
exportProgress.setIndeterminate(true);
exportProgress.setCancelable(false);
exportProgress.setCanceledOnTouchOutside(false);
exportProgress.setMessage(context.getString(R.string.export_notebook_to_pdf_progress));
}
@Override
protected void onPreExecute() throws Exception {
super.onPreExecute();
exportProgress.show();
}
@Override
public Void call() throws Exception {
WordprocessingMLPackage wordMLPackage = WordprocessingMLPackage.createPackage();
wordMLPackage.getMainDocumentPart().addParagraphOfText("Hello Word!");
File notebookDir = new File(Environment.getExternalStorageDirectory().getAbsolutePath() + File.separator + Constants.NOTEBOOKS_DIR);
if(!notebookDir.exists()) {
notebookDir.mkdir();
}
wordMLPackage.save(new File(notebookDir, course.getName() + Constants.DOCX_EXTENSION_FILE));
return null;
}
@Override
protected void onSuccess(Void result) throws Exception {
super.onSuccess(result);
DigitalNotebookActivity.this.finish();
}
@Override
protected void onFinally() throws RuntimeException {
super.onFinally();
if (exportProgress != null && exportProgress.isShowing()) {
exportProgress.dismiss();
}
}
}
Log:
05-25 22:41:42.927 29302-31419/com.digitalnotebook I/art﹕ Rejecting re-init on previously-failed class java.lang.Class 05-25 22:41:42.927 29302-31419/com.digitalnotebook I/art﹕ Rejecting re-init on previously-failed class java.lang.Class 05-25 22:41:42.957 29302-31419/com.digitalnotebook I/art﹕ Rejecting re-init on previously-failed class java.lang.Class 05-25 22:41:42.977 29302-31419/com.digitalnotebook I/art﹕ Rejecting re-init on previously-failed class java.lang.Class 05-25 22:41:43.027 29302-31419/com.digitalnotebook I/System.out﹕ 22:41:43.041 [pool-4-thread-8] INFO org.docx4j.jaxb.Context - java.vendor=The Android Project 05-25 22:41:43.027 29302-31419/com.digitalnotebook I/System.out﹕ 22:41:43.043 [pool-4-thread-8] INFO org.docx4j.jaxb.Context - java.version=0 05-25 22:41:43.137 29302-31419/com.digitalnotebook I/System.out﹕ 22:41:43.152 [pool-4-thread-8] DEBUG org.docx4j.utils.ResourceUtils - Attempting to load: org/docx4j/wml/jaxb.properties 05-25 22:41:43.147 29302-31419/com.digitalnotebook I/System.out﹕ 22:41:43.160 [pool-4-thread-8] DEBUG org.docx4j.utils.ResourceUtils - Not using MOXy, since no resource: org/docx4j/wml/jaxb.properties 05-25 22:41:43.147 29302-31419/com.digitalnotebook I/System.out﹕ 22:41:43.161 [pool-4-thread-8] INFO org.docx4j.jaxb.Context - No MOXy JAXB config found; assume not intended.. 05-25 22:41:43.147 29302-31419/com.digitalnotebook I/System.out﹕ 22:41:43.161 [pool-4-thread-8] DEBUG org.docx4j.jaxb.Context - org/docx4j/wml/jaxb.properties not found via classloader. 05-25 22:41:43.147 29302-31419/com.digitalnotebook I/art﹕ Rejecting re-init on previously-failed class java.lang.Class 05-25 22:41:43.157 29302-31419/com.digitalnotebook I/art﹕ Rejecting re-init on previously-failed class java.lang.Class 05-25 22:41:43.157 29302-31419/com.digitalnotebook I/art﹕ Rejecting re-init on previously-failed class java.lang.Class 05-25 22:41:43.157 29302-31419/com.digitalnotebook I/art﹕ Rejecting re-init on previously-failed class java.lang.Class 05-25 22:41:43.157 29302-31419/com.digitalnotebook I/art﹕ Rejecting re-init on previously-failed class java.lang.Class 05-25 22:41:43.157 29302-31419/com.digitalnotebook I/art﹕ Rejecting re-init on previously-failed class java.lang.Class 05-25 22:41:43.177 29302-31419/com.digitalnotebook I/art﹕ Rejecting re-init on previously-failed class java.lang.Class 05-25 22:41:43.177 29302-31419/com.digitalnotebook I/art﹕ Rejecting re-init on previously-failed class java.lang.Class 05-25 22:41:43.177 29302-31419/com.digitalnotebook I/art﹕ Rejecting re-init on previously-failed class java.lang.Class