diff --git a/android/jni/com/mapswithme/maps/MapStorage.cpp b/android/jni/com/mapswithme/maps/MapStorage.cpp index 8fca668bcf..0ff1483c74 100644 --- a/android/jni/com/mapswithme/maps/MapStorage.cpp +++ b/android/jni/com/mapswithme/maps/MapStorage.cpp @@ -54,14 +54,17 @@ extern "C" { JNIEnv * env = jni::GetEnv(); - jclass klass = env->FindClass("com/mapswithme/maps/MapStorage"); + jclass klass = env->FindClass("com/mapswithme/maps/MapStorage$Index"); ASSERT(klass, ()); - jmethodID methodId = env->GetStaticMethodID(klass, - "createIndex", "(III)Lcom/mapswithme/maps/MapStorage$Index;"); + jint group = idx.m_group; + jint country = idx.m_country; + jint region = idx.m_region; + + jmethodID methodID = env->GetMethodID(klass, "", "(III)V") ASSERT(methodId, ()); - return env->CallStaticObjectMethod(klass, methodId, idx.m_group, idx.m_country, idx.m_region); + return env->NewObject(klass, methodID, group, country, region); } }; diff --git a/android/src/com/mapswithme/maps/MapStorage.java b/android/src/com/mapswithme/maps/MapStorage.java index 595bc2d768..151579e7af 100644 --- a/android/src/com/mapswithme/maps/MapStorage.java +++ b/android/src/com/mapswithme/maps/MapStorage.java @@ -133,9 +133,4 @@ public class MapStorage return mInstance; } - - public static Index createIndex(int group, int country, int region) - { - return new Index(group, country, region); - } }