Skip to content

Commit 7a6a860

Browse files
committed
see 09/14 log
1 parent 71ba3a6 commit 7a6a860

File tree

2 files changed

+15
-12
lines changed

2 files changed

+15
-12
lines changed

utilcode/src/main/java/com/blankj/utilcode/utils/AppUtils.java

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
import android.net.Uri;
1212
import android.os.Build;
1313
import android.webkit.MimeTypeMap;
14-
import android.widget.Toast;
1514

1615
import java.io.File;
1716
import java.util.ArrayList;
@@ -32,20 +31,22 @@ private AppUtils() {
3231
}
3332

3433
/**
35-
* 安装App(支持6.0以上)
34+
* 获取安装App(支持6.0以上)的意图
3635
*
3736
* @param context 上下文
3837
* @param filePath 文件路径
38+
* @return 意图
3939
*/
40-
public static void installApp(Context context, String filePath) {
41-
installApp(context, FileUtils.getFileByPath(filePath));
40+
public static Intent installApp(Context context, String filePath) {
41+
return installApp(context, FileUtils.getFileByPath(filePath));
4242
}
4343

4444
/**
45-
* 安装App(支持6.0以上)
45+
* 获取安装App(支持6.0以上)的意图
4646
*
4747
* @param context 上下文
4848
* @param file 文件
49+
* @return 意图
4950
*/
5051
public static Intent installApp(Context context, File file) {
5152
if (file == null) return null;
@@ -62,10 +63,11 @@ public static Intent installApp(Context context, File file) {
6263
}
6364

6465
/**
65-
* 卸载指定包名的App
66+
* 获取卸载指定包名的App的意图
6667
*
6768
* @param context 上下文
6869
* @param packageName 包名
70+
* @return 意图
6971
*/
7072
public Intent uninstallApp(Context context, String packageName) {
7173
Intent intent = new Intent(Intent.ACTION_DELETE);
@@ -251,7 +253,7 @@ public static List<AppInfo> getAllAppsInfo(Context context) {
251253
*
252254
* @param context 上下文
253255
* @param packageName 包名
254-
* @return 意图
256+
* @return Intent
255257
*/
256258
private static Intent getIntentByPackageName(Context context, String packageName) {
257259
return context.getPackageManager().getLaunchIntentForPackage(packageName);
@@ -269,21 +271,22 @@ public static boolean isInstallApp(Context context, String packageName) {
269271
}
270272

271273
/**
272-
* 打开指定包名的App
274+
* 获取打开指定包名App的意图
273275
*
274276
* @param context 上下文
275277
* @param packageName 包名
276-
* @return {@code true}: 打开成功<br>{@code false}: 打开失败
278+
* @return 意图
277279
*/
278280
public static Intent openAppByPackageName(Context context, String packageName) {
279281
return getIntentByPackageName(context, packageName);
280282
}
281283

282284
/**
283-
* 打开指定包名的App应用信息界面
285+
* 获取打开指定包名的App应用信息的意图
284286
*
285287
* @param context 上下文
286288
* @param packageName 包名
289+
* @return 意图
287290
*/
288291
public static Intent openAppInfo(Context context, String packageName) {
289292
Intent intent = new Intent();
@@ -293,10 +296,11 @@ public static Intent openAppInfo(Context context, String packageName) {
293296
}
294297

295298
/**
296-
* 可用来做App信息分享
299+
* 获取App信息分享的意图
297300
*
298301
* @param context 上下文
299302
* @param info 分享信息
303+
* @return 意图
300304
*/
301305
public static Intent shareAppInfo(Context context, String info) {
302306
Intent intent = new Intent(Intent.ACTION_SEND);

utilcode/src/main/java/com/blankj/utilcode/utils/DeviceUtils.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ public static String getMacAddress(Context context) {
4444

4545
/**
4646
* 获取设备MAC地址
47-
* <p/>
4847
* <p>需添加权限 {@code <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>}</p>
4948
*
5049
* @return MAC地址

0 commit comments

Comments
 (0)