File tree Expand file tree Collapse file tree 4 files changed +7
-4
lines changed
app/src/main/java/com/vector/appupdatedemo
java/com/vector/update_app Expand file tree Collapse file tree 4 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -254,7 +254,7 @@ protected UpdateAppBean parseJson(String json) {
254254 //更新内容
255255 .setUpdate_log (jsonObject .getString ("update_log" ))
256256 //是否强制更新
257- .setConstraint (jsonObject . getBoolean ( "constraint" ) );
257+ .setConstraint (true );
258258 } catch (JSONException e ) {
259259 e .printStackTrace ();
260260 }
Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ publish {
4141 userOrg = ' qianwen' // bintray.com用户名
4242 groupId = ' com.qianwen' // jcenter上的路径
4343 artifactId = ' update-app' // 项目名称
44- publishVersion = ' 3.2.3 ' // 版本号
44+ publishVersion = ' 3.2.4 ' // 版本号
4545 desc = ' App update tools'
4646 website = ' https://github.com/WVector/AppUpdateDemo'
4747}
Original file line number Diff line number Diff line change 1111 <activity
1212 android : name =" .DialogActivity"
1313 android : configChanges =" keyboardHidden|orientation|locale|screenSize"
14- android : launchMode =" singleInstance"
1514 android : screenOrientation =" portrait"
1615 android : theme =" @style/UpdateAppDialog"
1716 android : windowSoftInputMode =" adjustPan|stateHidden" >
Original file line number Diff line number Diff line change 11package com .vector .update_app ;
22
33import android .content .ComponentName ;
4+ import android .content .Intent ;
45import android .content .ServiceConnection ;
56import android .graphics .Color ;
67import android .os .Bundle ;
@@ -246,7 +247,10 @@ public void onBackPressed() {
246247 //禁用
247248 if (mUpdateApp != null && mUpdateApp .isConstraint ()) {
248249// ActManager.getInstance().finishAllActivity();
249- android .os .Process .killProcess (android .os .Process .myPid ());
250+ // android.os.Process.killProcess(android.os.Process.myPid());
251+ //返回桌面
252+ startActivity (new Intent (Intent .ACTION_MAIN ).addCategory (Intent .CATEGORY_HOME ));
253+ return ;
250254 }
251255 super .onBackPressed ();
252256 }
You can’t perform that action at this time.
0 commit comments