我有一个名为 ForegroundService 的服务类,在 onstartCommand 中我需要设置一个变量:
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
VariableManaging.isStop=false; //<==variable i need to set. Here i got an exceptioninInitializer error when my bootReceiver start service on startup. If service is start by button on activity got no error.
}
变量管理类开始于:
static boolean isStop=true;
static ProgressDialog progressDialog=new ProgressDialog(Main.activity); //<== I noted that if i remove this all working well
有办法设置该变量吗?