GT框架导入
参考文档:https://blog.csdn.net/qq_39799899/article/details/119696907
maven { url 'https://jitpack.io' }
implementation 'com.github.1079374315:GSLS_Tool:v1.4.0.3'
服务中打开其它应用
final Intent intent = context.getPackageManager().getLaunchIntentForPackage("com.dilu.autograb");
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);
getApplication().startActivity(intent);
UI线程操作
GT.Thread.runAndroid(new Runnable() {
@Override
public void run() {
//UI线程操作
Date date = new Date(HaluoGrabHandle.nextRefreshTime);
statusTv.setText(date.getMinutes() + ":" + date.getSeconds() + "刷新");
}
});