Created
May 25, 2010 01:16
-
-
Save chmouel/412643 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Index: android/src/com/google/android/apps/chrometophone/C2DMReceiver.java | |
=================================================================== | |
--- android/src/com/google/android/apps/chrometophone/C2DMReceiver.java (revision 11) | |
+++ android/src/com/google/android/apps/chrometophone/C2DMReceiver.java (working copy) | |
@@ -82,6 +82,16 @@ | |
} | |
} | |
+ private String cyrketToMarket(String url) { | |
+ String ret = url.substring(32); | |
+ Log.w(TAG, "Converting cyrket link to market"); | |
+ | |
+ if (ret.endsWith("/")) | |
+ ret = ret.substring(0, ret.length() - 1); | |
+ return "market://search?q=pname:" + ret; | |
+ } | |
+ | |
+ | |
private void launchBrowserOrMaps(Context context, String url, String title) { | |
final String GMM_PACKAGE_NAME = "com.google.android.apps.maps"; | |
final String GMM_CLASS_NAME = "com.google.android.maps.MapsActivity"; | |
@@ -90,6 +100,9 @@ | |
RingtoneManager.getRingtone(context, | |
RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION)).play(); | |
+ if (url.startsWith("http://www.cyrket.com/p/android/")) | |
+ url = this.cyrketToMarket(url); | |
+ | |
try { | |
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url)); | |
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment