// 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;
package com.huijimuhe.commonlayout.utils;





/**
 * Created by Administrator on 2016/3/5.
 */
public class MarketUtils {
    /**
     * 获取已安装应用商店的包名列表
     *
     * @param context
     * @return
     */
    public static ArrayList<String> queryInstalledMarketPkgs(Context context) {
        ArrayList<String> pkgs = new ArrayList<String>();
        if (context == null)
            return pkgs;
        Intent intent = new Intent();
        intent.setAction("android.intent.action.MAIN");
        intent.addCategory("android.intent.category.APP_MARKET");
        PackageManager pm = context.getPackageManager();
// 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;

package com.huijimuhe.commonlayout.utils;





/**
 * Created by Administrator on 2016/3/5.
 */
public class MarketUtils {
    /**
     * 获取已安装应用商店的包名列表
     *
     * @param context
     * @return
     */
    public static ArrayList<String> queryInstalledMarketPkgs(Context context) {
        ArrayList<String> pkgs = new ArrayList<String>();
        if (context == null)
            return pkgs;
        Intent intent = new Intent();
        intent.setAction("android.intent.action.MAIN");
        intent.addCategory("android.intent.category.APP_MARKET");
        PackageManager pm = context.getPackageManager();
        List<ResolveInfo> infos = pm.queryIntentActivities(intent, 0);