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
b477048e
authored
Mar 13, 2020
by
pye52
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
现在在更新开始前会创建更新文件了
parent
ed1d63e3
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
1 deletions
+9
-1
app/src/main/java/com/bgycc/smartcanteen/MainActivity.java
+0
-1
app/src/main/java/com/bgycc/smartcanteen/command/UpdateCommandHandler.java
+9
-0
No files found.
app/src/main/java/com/bgycc/smartcanteen/MainActivity.java
View file @
b477048e
...
@@ -118,7 +118,6 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe
...
@@ -118,7 +118,6 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe
SCWebSocketClient
.
getInstance
().
getConnectStateEvent
().
observe
(
this
,
event
->
{
SCWebSocketClient
.
getInstance
().
getConnectStateEvent
().
observe
(
this
,
event
->
{
if
(
debugLayoutIsNotInflate
())
return
;
if
(
debugLayoutIsNotInflate
())
return
;
String
msg
;
String
msg
;
LogUtils
.
d
(
TAG
,
"connect state: "
+
event
.
getState
());
switch
(
event
.
getState
())
{
switch
(
event
.
getState
())
{
case
ConnectState
.
OFFLINE
:
case
ConnectState
.
OFFLINE
:
msg
=
String
.
format
(
getString
(
R
.
string
.
connect_offline
),
NetworkUtils
.
getTryingNetworkType
(
this
));
msg
=
String
.
format
(
getString
(
R
.
string
.
connect_offline
),
NetworkUtils
.
getTryingNetworkType
(
this
));
...
...
app/src/main/java/com/bgycc/smartcanteen/command/UpdateCommandHandler.java
View file @
b477048e
...
@@ -97,6 +97,15 @@ public class UpdateCommandHandler extends CommandHandler {
...
@@ -97,6 +97,15 @@ public class UpdateCommandHandler extends CommandHandler {
}
}
start
=
true
;
start
=
true
;
FileUtils
.
delete
(
updateApk
);
FileUtils
.
delete
(
updateApk
);
boolean
createApk
=
false
;
try
{
createApk
=
updateApk
.
createNewFile
();
}
catch
(
IOException
e
)
{
LogUtils
.
e
(
TAG
,
"更新包文件创建失败: "
+
e
.
getMessage
(),
e
);
}
if
(!
createApk
)
{
return
failedResult
(
"更新包文件创建失败"
);
}
if
(
executor
==
null
)
{
if
(
executor
==
null
)
{
executor
=
Executors
.
newScheduledThreadPool
(
1
);
executor
=
Executors
.
newScheduledThreadPool
(
1
);
}
}
...
...
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