Add support for search from the notification

This commit is contained in:
Alex Sytnyk 2018-10-22 13:01:05 +03:00
parent 1d8ded44bb
commit 3b9e3d2b56

View file

@ -45,6 +45,7 @@ public class DiscountHelper {
private static boolean mBannerVisible;
private static final String URL = "https://osmand.net/api/motd";
private static final String INAPP_PREFIX = "osmand-in-app:";
private static final String SEARCH_QUERY_PREFIX = "osmand-search-query:";
public static void checkAndDisplay(final MapActivity mapActivity) {
@ -227,6 +228,11 @@ public class DiscountHelper {
} else if (url.contains(InAppPurchaseHelper.SKU_LIVE_UPDATES)) {
ChoosePlanDialogFragment.showOsmLiveInstance(mapActivity.getSupportFragmentManager());
}
} else if (url.startsWith(SEARCH_QUERY_PREFIX)) {
String query = url.substring(SEARCH_QUERY_PREFIX.length());
if (!query.isEmpty()) {
mapActivity.showQuickSearch(query);
}
} else {
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse(url));