如题所述
/**
* 判断包名所对应的应用是否安装在SD卡上
* @param packageName
* @return, true if install on SD card
*/
public static boolean isInstallOnSDCard(String packageName) {
PackageManager pm = LauncherApplication.getApp().getPackageManager();
ApplicationInfo appInfo;
try {
appInfo = pm.getApplicationInfo(packageName, 0);
if ((appInfo.flags & ApplicationInfo.FLAG_EXTERNAL_STORAGE) != 0) {
return true;
}
} catch (NameNotFoundException e) {
e.printStackTrace();
}
* 判断包名所对应的应用是否安装在SD卡上
* @param packageName
* @return, true if install on SD card
*/
public static boolean isInstallOnSDCard(String packageName) {
PackageManager pm = LauncherApplication.getApp().getPackageManager();
ApplicationInfo appInfo;
try {
appInfo = pm.getApplicationInfo(packageName, 0);
if ((appInfo.flags & ApplicationInfo.FLAG_EXTERNAL_STORAGE) != 0) {
return true;
}
} catch (NameNotFoundException e) {
e.printStackTrace();
}
温馨提示:答案为网友推荐,仅供参考