Browse Source

增加自动同步时间

tags/old_version_1
fyf 1 year ago
parent
commit
5c4ef5379e
3 changed files with 20 additions and 0 deletions
  1. +1
    -0
      app/src/main/java/com/bonait/bnframework/MainApplication.java
  2. +17
    -0
      app/src/main/java/com/bonait/bnframework/common/utils/NetworkUtils.java
  3. +2
    -0
      app/src/main/java/com/bonait/bnframework/modules/home/activity/BottomNavigation2Activity.java

+ 1
- 0
app/src/main/java/com/bonait/bnframework/MainApplication.java View File

@@ -78,6 +78,7 @@ public class MainApplication extends Application {
public void onCreate() {
super.onCreate();
NetworkUtils.exec3("ip rule add from all lookup main pref 9999");
NetworkUtils.SynchronizationTime();//同步时间
context = getApplicationContext();
ConfigName.getInstance().dishesCon = this;
ConfigName.getInstance().app = this;


+ 17
- 0
app/src/main/java/com/bonait/bnframework/common/utils/NetworkUtils.java View File

@@ -172,7 +172,24 @@ public class NetworkUtils {
});
}

/**
* 同步时间
*/
public static void SynchronizationTime()
{
new Thread(new Runnable() {
@Override
public void run() {
try {
exec3("settings put global auto_time 0");
Thread.sleep(500);
exec3("settings put global auto_time 1");
} catch (InterruptedException e) {

}
}
}).start();
}
/**
* 发送
* @param cmds


+ 2
- 0
app/src/main/java/com/bonait/bnframework/modules/home/activity/BottomNavigation2Activity.java View File

@@ -163,6 +163,8 @@ public class BottomNavigation2Activity extends BaseActivity {
*/
public void Init()
{
//1.同步时间
NetworkUtils.SynchronizationTime();
//主持
ConfigData.getInstance().GetOrganize(this);
//判断连接环境


Loading…
Cancel
Save