From 76138e00def99ac41ee8a213036d23a7695d8ad5 Mon Sep 17 00:00:00 2001 From: GaidamakUA Date: Fri, 23 Oct 2015 10:51:35 +0300 Subject: [PATCH] Get full version fix --- .../net/osmand/plus/download/DownloadActivity.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/download/DownloadActivity.java b/OsmAnd/src/net/osmand/plus/download/DownloadActivity.java index 947d4c9411..4c0d19b9f7 100644 --- a/OsmAnd/src/net/osmand/plus/download/DownloadActivity.java +++ b/OsmAnd/src/net/osmand/plus/download/DownloadActivity.java @@ -10,6 +10,7 @@ import java.util.Locale; import java.util.Set; import net.osmand.IProgress; +import net.osmand.PlatformUtil; import net.osmand.access.AccessibleToast; import net.osmand.plus.OsmandApplication; import net.osmand.plus.OsmandSettings; @@ -45,7 +46,11 @@ import android.widget.ProgressBar; import android.widget.TextView; import android.widget.Toast; +import org.apache.commons.logging.Log; + public class DownloadActivity extends ActionBarProgressActivity implements DownloadEvents { + private static final Log LOG = PlatformUtil.getLog(DownloadActivity.class); + public static final int UPDATES_TAB_NUMBER = 2; public static final int LOCAL_TAB_NUMBER = 1; public static final int DOWNLOAD_TAB_NUMBER = 0; @@ -384,12 +389,12 @@ public class DownloadActivity extends ActionBarProgressActivity implements Downl freeVersionBanner.findViewById(R.id.getFullVersionButton).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { - Activity context = (Activity) v.getContext(); - Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(Version.marketPrefix((OsmandApplication) context - .getApplication()) + "net.osmand.plus")); + Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(Version.marketPrefix( + ctx.getMyApplication()) + "net.osmand.plus")); try { - context.startActivity(intent); + ctx.startActivity(intent); } catch (ActivityNotFoundException e) { + LOG.error("ActivityNotFoundException", e); } } });