通过线程执行,避免ANR

nx2024
Matthew 3 months ago
parent f8e6cdb23a
commit 9ed8ca011d

@ -393,6 +393,17 @@ public class MpMasterService extends Service {
public boolean shouldSyncTime() { return mSyncTime; } public boolean shouldSyncTime() { return mSyncTime; }
public void detectMpAppAlive() { public void detectMpAppAlive() {
final MpMasterService thisObj = this;
Thread th = new Thread(new Runnable() {
@Override
public void run() {
thisObj.detectMpAppAliveImpl();
}
});
th.start();
}
private void detectMpAppAliveImpl() {
try { try {
final Context context = getApplicationContext(); final Context context = getApplicationContext();
long ts = System.currentTimeMillis(); long ts = System.currentTimeMillis();

Loading…
Cancel
Save