mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 20:33:53 +01:00
Rate Us method added to Utils.java and called on AboutActivity.java
This commit is contained in:
parent
4432f2ca1a
commit
fc8b522ac4
11 changed files with 30 additions and 18 deletions
|
|
@ -1,6 +1,8 @@
|
|||
package fr.free.nrw.commons;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.support.annotation.NonNull;
|
||||
|
||||
|
|
@ -159,4 +161,15 @@ public class Utils {
|
|||
|
||||
return stringBuilder.toString();
|
||||
}
|
||||
}
|
||||
|
||||
public static void rateApp(Context context) {
|
||||
final String appPackageName = context.getPackageName();
|
||||
try {
|
||||
context.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + appPackageName)));
|
||||
}
|
||||
catch (android.content.ActivityNotFoundException anfe) {
|
||||
context.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://play.google.com/store/apps/details?id=" + appPackageName)));
|
||||
}
|
||||
return ;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue