Skip to content

Commit

Permalink
20210522 埋一些log检查安装需要手动点的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
zyzzchehe committed May 22, 2021
1 parent 9486d6d commit 2732b34
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion mylibrary/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ dependencies {
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'

implementation 'com.github.zyzzchehe:MyCommonUtils:2.2'
implementation 'com.github.greenrobot.EventBus:eventbus:V3.2.0'
}
7 changes: 5 additions & 2 deletions mylibrary/src/main/java/com/zc/mylibrary/DownloadApkTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
import androidx.annotation.NonNull;
import androidx.core.content.FileProvider;

import com.zc.commonutilslib.MLog;

import org.greenrobot.eventbus.EventBus;

import java.io.File;
Expand Down Expand Up @@ -164,7 +166,7 @@ protected void onProgressUpdate(Float... values) {
@Override
protected void onPostExecute(String s) {
super.onPostExecute(s);
Log.i(TAG, "onPostExecute: apk save path = " + s);
MLog.i(TAG, "onPostExecute: apk save path = " + s);
DownloadProgressDialogUtils.closeProgressDialog();
Intent intent = new Intent();
intent.setAction(Intent.ACTION_VIEW);
Expand All @@ -184,8 +186,9 @@ protected void onPostExecute(String s) {
}
}
} else {
MLog.i(TAG, "onPostExecute: start install apk");
intent.setDataAndType(Uri.fromFile(apkFile), "application/vnd.android.package-archive");
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
}
if (context.getPackageManager().queryIntentActivities(intent, 0).size() > 0) {
context.startActivity(intent);
Expand Down

0 comments on commit 2732b34

Please sign in to comment.