如果我有以下代码:
Intent intent = new Intent(this,DownloadService.class);
for(int i=0;i<filesArray.length;i++){
startService(intent);
}
Run Code Online (Sandbox Code Playgroud)
在此代码中DownloadService扩展IntentService.
所以现在,当我打电话时startService(intent),这意味着每次调用我都会启动一项新服务,startService(intent)或者这意味着它DownloadService会运行一次,然后每次调用startService(intent)它时,只会使用不同的startId传递不同的意图.
这是否有意义,以及其中哪一个是这样的?
android ×1