Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
huangzhicong
/
SmartCanteen
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
cd63d6ca
authored
Mar 17, 2020
by
pye52
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
不再检查更新包是否存在,直接进入安装步骤
parent
5e9d3cd1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
12 deletions
+0
-12
daemon/src/main/java/com/bgycc/smartcanteen/daemon/DaemonService.java
+0
-12
No files found.
daemon/src/main/java/com/bgycc/smartcanteen/daemon/DaemonService.java
View file @
cd63d6ca
package
com
.
bgycc
.
smartcanteen
.
daemon
;
import
android.app.Service
;
import
android.content.ComponentName
;
import
android.content.Intent
;
import
android.os.IBinder
;
import
android.text.TextUtils
;
...
...
@@ -32,17 +31,6 @@ public class DaemonService extends Service {
path
=
PathUtils
.
getExternalStoragePath
()
+
File
.
separator
+
UPDATE_APK
;
LogUtils
.
d
(
TAG
,
"安装apk地址为空,使用默认地址: "
+
path
);
}
// 当找不到安装apk时,直接启动主应用
if
(!
FileUtils
.
isFileExists
(
path
))
{
LogUtils
.
w
(
TAG
,
"安装失败, 找不到apk,重新启动主应用"
);
ComponentName
componentName
=
new
ComponentName
(
MAIN_PACKAGE_NAME
,
MAIN_ACTIVITY_NAME
);
Intent
startMainActivity
=
new
Intent
();
intent
.
addFlags
(
Intent
.
FLAG_ACTIVITY_NEW_TASK
);
intent
.
setComponent
(
componentName
);
startActivity
(
startMainActivity
);
stopSelf
(
START_NOT_STICKY
);
return
START_NOT_STICKY
;
}
String
component
=
intent
.
getStringExtra
(
ARG_COMPONENT
);
if
(
TextUtils
.
isEmpty
(
component
))
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment