Files
WebODF/programs/android/src/org/webodf/WebODFActivity.java
T
Jos van den Oever dab5e2d1bf Switch to a sencha touch based ui.
This ui is shared with the iOS version of WebODF.
2011-12-13 08:50:42 +01:00

33 lines
741 B
Java

package org.webodf;
import android.os.Bundle;
import com.phonegap.DroidGap;
public class WebODFActivity extends DroidGap {
private String path;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
path = null;
if (getIntent() != null && getIntent().getData() != null) {
path = getIntent().getData().getPath();
}
setContentView(R.layout.main);
super.loadUrl("file:///android_asset/www/index.html");
}
@Override
protected void onResume() {
super.onResume();
if (path == null) {
return;
}
String escapedPath = "file://" + path.replace("'", "\\'");
sendJavascript("invokeString = '" + escapedPath + "';");
}
}