mirror of
https://github.com/webodf/WebODF.git
synced 2026-11-30 16:47:58 +01:00
Fix android version so it now opens files from mail and file browser again.
This commit is contained in:
@@ -25,8 +25,8 @@ import android.view.MenuItem;
|
||||
public class WebODFActivity extends DroidGap {
|
||||
|
||||
private String path;
|
||||
private ZipReader zipreader;
|
||||
|
||||
private ZipReader zipreader;
|
||||
|
||||
/** Called when the activity is first created. */
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
@@ -39,16 +39,21 @@ public class WebODFActivity extends DroidGap {
|
||||
super.loadUrl("file:///android_asset/www/index.html");
|
||||
}
|
||||
|
||||
private void openOdfFile() {
|
||||
if (path == null) {
|
||||
return;
|
||||
}
|
||||
String escapedPath = "file://" + path.replace("'", "\\'");
|
||||
sendJavascript("invokeString = '" + escapedPath
|
||||
+ "';application.openUrl(invokeString);");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
zipreader = new ZipReader(appView);
|
||||
appView.addJavascriptInterface(zipreader, "zipreader");
|
||||
if (path == null) {
|
||||
return;
|
||||
}
|
||||
String escapedPath = "file://" + path.replace("'", "\\'");
|
||||
sendJavascript("invokeString = '" + escapedPath + "';");
|
||||
openOdfFile();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -148,7 +153,7 @@ public class WebODFActivity extends DroidGap {
|
||||
|
||||
private void reportIssue() {
|
||||
File screenshotfile = takeScreenShot();
|
||||
File odffile = (path == null) ?null :new File(path);
|
||||
File odffile = (path == null) ? null : new File(path);
|
||||
File attachmentfile = null;
|
||||
String type = "text/plain";
|
||||
if (screenshotfile != null) {
|
||||
|
||||
Reference in New Issue
Block a user