Commit a13d8910 by sikang

添加带包名的statGooglPlay()重载

parent 90c09ce4
......@@ -24,7 +24,7 @@ import tech.starwin.utils.ui_utils.DialogManager;
* Intent的创建和使用
*/
public class ActivityJumper {
private static String GP_APP_DETAIL_URL = "https://play.google.com/store/apps/details?id=" + LibConfig.APPLICATION_ID;
private static String GP_APP_DETAIL_URL = "https://play.google.com/store/apps/details?id=";
private Intent intent;
/**
* 发起跳转的Context
......@@ -96,10 +96,14 @@ public class ActivityJumper {
* 去 GooglePlay下载页
*/
public static void startGooglePlay(Context context) {
startGooglePlay(context, LibConfig.APPLICATION_ID);
}
public static void startGooglePlay(Context context, String packageName) {
try {
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(GP_APP_DETAIL_URL));
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(GP_APP_DETAIL_URL + packageName));
List<ResolveInfo> resolveInfos = context.getPackageManager().queryIntentActivities(intent, 0);
if (resolveInfos != null && resolveInfos.size() > 0){
if (resolveInfos != null && resolveInfos.size() > 0) {
for (ResolveInfo resolveInfo : resolveInfos) {
if (resolveInfo.activityInfo.packageName.toLowerCase().contains("com.android.vending")
|| resolveInfo.activityInfo.name.toLowerCase().contains("com.android.vending")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment