Skip to content

Commit 7627289

Browse files
committed
release
1 parent f9cf6b9 commit 7627289

File tree

2 files changed

+20
-4
lines changed

2 files changed

+20
-4
lines changed

app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ android {
88
applicationId "com.duy.pascal.compiler"
99
minSdkVersion rootProject.ext.minSdkVersion as Integer
1010
targetSdkVersion rootProject.ext.targetSdkVersion as Integer
11-
versionCode 113
12-
versionName "4.1.0"
11+
versionCode 114
12+
versionName "4.1.1"
1313
vectorDrawables.useSupportLibrary = true
1414
multiDexEnabled true
1515
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

app/src/main/java/com/duy/pascal/frontend/utils/StoreUtil.java

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,24 @@ public static void gotoPlayStore(Activity context, String APP_ID) {
3434
try {
3535
context.startActivity(goToMarket);
3636
} catch (ActivityNotFoundException e) {
37-
context.startActivity(new Intent(Intent.ACTION_VIEW,
38-
Uri.parse("http://play.google.com/store/apps/details?id=" + APP_ID)));
37+
Uri link = Uri.parse("http://play.google.com/store/apps/details?id=" + APP_ID);
38+
Intent intent = new Intent(Intent.ACTION_VIEW, link);
39+
context.startActivity(intent);
40+
}
41+
}
42+
43+
public static void gotoPlayStore(Activity context, String APP_ID, int request) {
44+
Uri uri = Uri.parse("market://details?id=" + APP_ID);
45+
Intent goToMarket = new Intent(Intent.ACTION_VIEW, uri);
46+
// To count with Play market backstack, After pressing back button,
47+
// to taken back to our application, we need to add following flags to intent.
48+
goToMarket.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY | Intent.FLAG_ACTIVITY_MULTIPLE_TASK);
49+
try {
50+
context.startActivity(goToMarket);
51+
} catch (ActivityNotFoundException e) {
52+
Uri link = Uri.parse("http://play.google.com/store/apps/details?id=" + APP_ID);
53+
Intent intent = new Intent(Intent.ACTION_VIEW, link);
54+
context.startActivityForResult(intent, request);
3955
}
4056
}
4157

0 commit comments

Comments
 (0)