/**返回本手机已安装的所有市场*/
public static List<String> getAllInstall3Market(Context context) {
List<String> p3Name = null;
PackageManager packageManager = context.getPackageManager();
Intent intent = new Intent();
intent.setAction("android.intent.action.MAIN");
intent.addCategory("android.intent.category.APP_MARKET");
List<ResolveInfo> infos = packageManager.queryIntentActivities(intent, 0);
int size = infos.size();
if (size > 0) {
p3Name = new ArrayList<String>();
for (int i = 0; i < size; i++) {
p3Name.add(infos.get(i).activityInfo.packageName);
}
}
return p3Name;
}
有可能不准,但是市面上绝大部分都是可以滴。