我currenly这样做时,我点击了一个按钮Android的意图问题
Intent service = new Intent(this, LocationCheckingService.class);
startService(service);
,如果我在哪里可以点击这个按钮多次它导致多个线程被调用?可能会阻止多项服务?因为我只需要一个服务
我currenly这样做时,我点击了一个按钮Android的意图问题
Intent service = new Intent(this, LocationCheckingService.class);
startService(service);
,如果我在哪里可以点击这个按钮多次它导致多个线程被调用?可能会阻止多项服务?因为我只需要一个服务
只能有一个服务的instace。不管有多少次你开始 看到这个discussion
哦,所以这意味着它只是一个服务之前检查该标志标识设置为true将开始?如果它再次被召回,则不会被召唤,而只会被启动仪式 – ericlee 2011-05-01 21:21:01
@ user492182考虑初始化isServiceStarted假标志,一旦你调用startService,然后调用startService – JAL 2011-05-01 23:42:45