Code example for ExecutorService

Methods: shutdownNow

0
 
    @Override 
    public void onDestroy() { 
        //Log.d(TAG, "service destroyed"); 
        if (mThreadPool != null) {
            mThreadPool.shutdownNow();
            // TODO: Await termination??? 
        } 
    } 
 
    // 
    // This is the old onStart method that will be called on the pre-2.0 
    // platform. On 2.0 or later we override onStartCommand so this 
    // method will not be called. 
    // 
    @Override 
    public void onStart(Intent intent, int startId) {
        handleCommand(intent, startId);
    } 
 
    @Override