// Path: CommonLayout/app/src/main/java/com/huijimuhe/commonlayout/AppContext.java
// public class AppContext extends Application {
//     private static AppContext INSTANCE=null;
// 
//     @Override
//     public void onCreate() {
//         super.onCreate();
//         INSTANCE=this;
//     }
// 
//     public static AppContext getInstance(){return INSTANCE;}
// }


import android.content.Context;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.net.Uri;
import android.text.TextUtils;
import com.huijimuhe.commonlayout.AppContext;
import java.util.ArrayList;
import java.util.List;
                }
                if (TextUtils.isEmpty(installPkg))
                    continue;
                if (installPkg.equals(checkPkg)) {
                    empty.add(installPkg);
                    break;
                }

            }
        }
        return empty;
    }

    /**
     * 启动到app详情界面
     *
     * @param appPkg
     *            App的包名
     * @param marketPkg
     *            应用商店包名 ,如果为""则由系统弹出应用商店列表供用户选择,否则调转到目标市场的应用详情界面，某些应用商店可能会失败
     */
    public static void launchAppDetail(String appPkg, String marketPkg) {
        try {
            if (TextUtils.isEmpty(appPkg))
                return;
            Uri uri = Uri.parse("market://details?id=" + appPkg);
            Intent intent = new Intent(Intent.ACTION_VIEW, uri);
            if (!TextUtils.isEmpty(marketPkg))
                intent.setPackage(marketPkg);
            intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
// Path: CommonLayout/app/src/main/java/com/huijimuhe/commonlayout/AppContext.java
// public class AppContext extends Application {
//     private static AppContext INSTANCE=null;
// 
//     @Override
//     public void onCreate() {
//         super.onCreate();
//         INSTANCE=this;
//     }
// 
//     public static AppContext getInstance(){return INSTANCE;}
// }


// Path: CommonLayout/app/src/main/java/com/huijimuhe/commonlayout/utils/MarketUtils.java
import android.content.Context;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.net.Uri;
import android.text.TextUtils;
import com.huijimuhe.commonlayout.AppContext;
import java.util.ArrayList;
import java.util.List;

                }
                if (TextUtils.isEmpty(installPkg))
                    continue;
                if (installPkg.equals(checkPkg)) {
                    empty.add(installPkg);
                    break;
                }

            }
        }
        return empty;
    }

    /**
     * 启动到app详情界面
     *
     * @param appPkg
     *            App的包名
     * @param marketPkg
     *            应用商店包名 ,如果为""则由系统弹出应用商店列表供用户选择,否则调转到目标市场的应用详情界面，某些应用商店可能会失败
     */
    public static void launchAppDetail(String appPkg, String marketPkg) {
        try {
            if (TextUtils.isEmpty(appPkg))
                return;
            Uri uri = Uri.parse("market://details?id=" + appPkg);
            Intent intent = new Intent(Intent.ACTION_VIEW, uri);
            if (!TextUtils.isEmpty(marketPkg))
                intent.setPackage(marketPkg);
            intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
            AppContext.getInstance().startActivity(intent);