diff --git a/android/jni/com/mapswithme/maps/MWMActivity.cpp b/android/jni/com/mapswithme/maps/MWMActivity.cpp index 1d991a2f0f..aa646e5ff3 100644 --- a/android/jni/com/mapswithme/maps/MWMActivity.cpp +++ b/android/jni/com/mapswithme/maps/MWMActivity.cpp @@ -18,14 +18,10 @@ Java_com_mapswithme_maps_MWMActivity_nativeInit(JNIEnv * env, jobject thiz, int jni::GetString(env, apkPath), jni::GetString(env, storagePath), jni::GetString(env, tmpPath), jni::GetString(env, extTmpPath), jni::GetString(env, settingsPath)); - g_framework = new android::Framework(); -} -JNIEXPORT void JNICALL -Java_com_mapswithme_maps_MWMActivity_nativeDestroy(JNIEnv * env, jobject thiz) -{ - delete g_framework; - g_framework = 0; + // @TODO framework is never deleted, it's needed for download activity too + if (!g_framework) + g_framework = new android::Framework(); } //////////////////////////////////////////////////////////////////////////////////////////// diff --git a/android/src/com/mapswithme/maps/MWMActivity.java b/android/src/com/mapswithme/maps/MWMActivity.java index 311b15e52a..0c163ea887 100644 --- a/android/src/com/mapswithme/maps/MWMActivity.java +++ b/android/src/com/mapswithme/maps/MWMActivity.java @@ -159,14 +159,14 @@ public class MWMActivity extends SmartGLActivity implements // Get screen density DisplayMetrics metrics = new DisplayMetrics(); getWindowManager().getDefaultDisplay().getMetrics(metrics); - - nativeInit(metrics.densityDpi, + + nativeInit(metrics.densityDpi, metrics.widthPixels, metrics.heightPixels, - getAppBundlePath(), - extStoragePath, - getTmpPath(), - extTmpPath, + getAppBundlePath(), + extStoragePath, + getTmpPath(), + extTmpPath, getSettingsPath()); checkMeasurementSystem(); @@ -174,13 +174,6 @@ public class MWMActivity extends SmartGLActivity implements m_locationService = new LocationService(this); } - @Override - public void onDestroy() - { - nativeDestroy(); - super.onDestroy(); - } - // From Location interface public void onLocationStatusChanged(int newStatus) { @@ -240,7 +233,7 @@ public class MWMActivity extends SmartGLActivity implements case R.id.menuitem_about_dialog: onAboutDialogClicked(); return true; - + default: return super.onOptionsItemSelected(item); } @@ -368,7 +361,6 @@ public class MWMActivity extends SmartGLActivity implements private native void nativeInit(int densityDpi, int screenWidth, int screenHeight, String apkPath, String storagePath, String tmpPath, String extTmpPath, String settingsPath); - private native void nativeDestroy(); private native void nativeLocationStatusChanged(int newStatus); private native void nativeLocationUpdated(long time, double lat, double lon, float accuracy); private native void nativeCompassUpdated(long time, double magneticNorth, double trueNorth, float accuracy);