public class AppUtils extends Object
限定符和类型 | 方法和说明 |
---|---|
static void |
changeLocale(Context context,
Locale locale)
修改locale ,修改后只对新生成activity有效,旧的activity需要重启
|
static List<PackageInfo> |
getAllApps(Context context)
获取所有非系统应用
|
static Drawable |
getApplicationIcon(Context context,
String apkPath)
获取apk应用icon
|
static ApplicationInfo |
getApplicationInfo(Context context,
String apkPath)
获取应用信息
|
static String |
getPackageName(Context context,
String apkPath)
获取apk应用包名
|
static void |
install(Context context,
String apkPath)
安装apk文件
|
static void |
install(Context context,
Uri apkUri)
安装apk文件
|
static boolean |
isInstalled(Context context,
String packageName)
判断是否安装应用
|
static void |
launch(Context context,
String packageName)
启动应用
|
static void |
unInstall(Context context,
String packageName)
卸载应用
|
public static void changeLocale(Context context, Locale locale)
context
- locale
- public static void install(Context context, Uri apkUri)
context
- apkUri
- public static void install(Context context, String apkPath)
context
- apkPath
- public static void unInstall(Context context, String packageName)
context
- packageName
- public static void launch(Context context, String packageName)
context
- packageName
- public static boolean isInstalled(Context context, String packageName)
context
- packageName
- public static String getPackageName(Context context, String apkPath)
context
- apkPath
- public static Drawable getApplicationIcon(Context context, String apkPath)
context
- apkPath
- public static ApplicationInfo getApplicationInfo(Context context, String apkPath)
context
- apkPath
- public static List<PackageInfo> getAllApps(Context context)
context
-