|
@@ -13,7 +13,6 @@ public class PalActivity extends SDLActivity {
|
|
|
private static final String TAG = "sdlpal-debug";
|
|
|
private static MediaPlayer mediaPlayer;
|
|
|
|
|
|
- public static native void setAppPath(String basepath, String datapath, String cachepath);
|
|
|
public static native void setScreenSize(int width, int height);
|
|
|
|
|
|
public static boolean crashed = false;
|
|
@@ -36,30 +35,9 @@ public class PalActivity extends SDLActivity {
|
|
|
public void onCreate(Bundle savedInstanceState) {
|
|
|
super.onCreate(savedInstanceState);
|
|
|
|
|
|
- String dataPath = getApplicationContext().getFilesDir().getPath();
|
|
|
- String cachePath = getApplicationContext().getCacheDir().getPath();
|
|
|
- String sdcardState = Environment.getExternalStorageState();
|
|
|
- if (sdcardState.equals(Environment.MEDIA_MOUNTED)){
|
|
|
- setAppPath(Environment.getExternalStorageDirectory().getPath() + "/sdlpal/", dataPath, cachePath);
|
|
|
- } else {
|
|
|
- setAppPath("/sdcard/sdlpal/", dataPath, cachePath);
|
|
|
- }
|
|
|
-
|
|
|
DisplayMetrics metrics = new DisplayMetrics();
|
|
|
getWindowManager().getDefaultDisplay().getMetrics(metrics);
|
|
|
setScreenSize(metrics.widthPixels, metrics.heightPixels);
|
|
|
-
|
|
|
- File runningFile = new File(cachePath + "/running");
|
|
|
- crashed = runningFile.exists();
|
|
|
-
|
|
|
- if (SettingsActivity.loadConfigFile() || crashed) {
|
|
|
- runningFile.delete();
|
|
|
-
|
|
|
- Intent intent = new Intent(this, SettingsActivity.class);
|
|
|
- intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
|
|
|
- startActivity(intent);
|
|
|
- finish();
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
@Override
|