forked from organicmaps/organicmaps
[android] Fixed search engine intialization, i.e. made it same as for other singletons
This commit is contained in:
parent
0ca59fa19b
commit
ead3240223
2 changed files with 17 additions and 6 deletions
|
@ -28,6 +28,7 @@ import com.mapswithme.maps.maplayer.traffic.TrafficManager;
|
|||
import com.mapswithme.maps.routing.RoutingController;
|
||||
import com.mapswithme.maps.scheduling.ConnectivityJobScheduler;
|
||||
import com.mapswithme.maps.scheduling.ConnectivityListener;
|
||||
import com.mapswithme.maps.search.SearchEngine;
|
||||
import com.mapswithme.maps.sound.TtsPlayer;
|
||||
import com.mapswithme.maps.ugc.UGC;
|
||||
import com.mapswithme.util.Config;
|
||||
|
@ -270,6 +271,7 @@ public class MwmApplication extends Application
|
|||
MapManager.nativeSubscribe(mStorageCallbacks);
|
||||
|
||||
initNativeStrings();
|
||||
SearchEngine.INSTANCE.initialize();
|
||||
BookmarkManager.loadBookmarks();
|
||||
TtsPlayer.INSTANCE.init(this);
|
||||
ThemeSwitcher.restart(false);
|
||||
|
|
|
@ -6,6 +6,7 @@ import android.support.annotation.Nullable;
|
|||
|
||||
import com.mapswithme.maps.Framework;
|
||||
import com.mapswithme.maps.api.ParsedMwmRequest;
|
||||
import com.mapswithme.maps.base.Initializable;
|
||||
import com.mapswithme.maps.bookmarks.data.FeatureId;
|
||||
import com.mapswithme.util.Language;
|
||||
import com.mapswithme.util.Listeners;
|
||||
|
@ -15,7 +16,8 @@ import java.io.UnsupportedEncodingException;
|
|||
|
||||
public enum SearchEngine implements NativeSearchListener,
|
||||
NativeMapSearchListener,
|
||||
NativeBookingFilterListener
|
||||
NativeBookingFilterListener,
|
||||
Initializable
|
||||
{
|
||||
INSTANCE;
|
||||
|
||||
|
@ -119,11 +121,6 @@ public enum SearchEngine implements NativeSearchListener,
|
|||
mHotelListeners.unregister(listener);
|
||||
}
|
||||
|
||||
SearchEngine()
|
||||
{
|
||||
nativeInit();
|
||||
}
|
||||
|
||||
private native void nativeInit();
|
||||
|
||||
/**
|
||||
|
@ -218,6 +215,18 @@ public enum SearchEngine implements NativeSearchListener,
|
|||
nativeShowResult(index);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initialize()
|
||||
{
|
||||
nativeInit();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void destroy()
|
||||
{
|
||||
// Do nothing.
|
||||
}
|
||||
|
||||
/**
|
||||
* @param bytes utf-8 formatted bytes of query.
|
||||
*/
|
||||
|
|
Loading…
Add table
Reference in a new issue