Chromium Code Reviews| Index: samples/android_sample/src/com/google/dartndk/DummyActivity.java |
| diff --git a/samples/android_sample/src/com/google/dartndk/DummyActivity.java b/samples/android_sample/src/com/google/dartndk/DummyActivity.java |
| index 3eb3b7b952f101780187f48ff82c09effd4ea143..17714b82a9fd3402b48977d5c49154fe59bb693f 100644 |
| --- a/samples/android_sample/src/com/google/dartndk/DummyActivity.java |
| +++ b/samples/android_sample/src/com/google/dartndk/DummyActivity.java |
| @@ -14,28 +14,27 @@ import android.util.Log; |
| public class DummyActivity extends NativeActivity { |
| static { |
| System.loadLibrary("android_embedder"); |
| - System.loadLibrary("DartNDK"); |
|
gram
2013/01/09 17:51:36
I don't think we need to worry about this right no
vsm
2013/01/09 18:41:24
I actually tried to get rid of this and ran into a
|
| } |
| - |
| + |
| @Override |
| public void onCreate(Bundle savedInstanceState) { |
| - super.onCreate(savedInstanceState); |
| - try { |
| + super.onCreate(savedInstanceState); |
| + try { |
| File localDir = getApplicationContext().getDir("dart", 0); |
| String fileSystemPath = localDir.toString(); |
| String assetPath = "dart"; |
| AssetManager assetManager = getAssets(); |
| String[] files = assetManager.list(assetPath); |
| byte[] buffer = new byte[1024]; |
| - int read; |
| + int read; |
| for (String filename : files) { |
| String dest = fileSystemPath + "/" + filename; |
| - Log.w("Dart", "Copying " + dest); |
| + Log.w("Dart", "Copying " + dest); |
| InputStream in = assetManager.open(assetPath + "/" + filename); |
| OutputStream out = new FileOutputStream(dest); |
| while((read = in.read(buffer)) != -1){ |
| out.write(buffer, 0, read); |
| - } |
| + } |
| in.close(); |
| out.flush(); |
| ((FileOutputStream)out).getFD().sync(); |